Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access Global .resx file in ASP.Net View Page

I am currently building in Version 3.5 of the .Net framework and I have a resource (.resx) file that I am trying to access in a web application. I have exposed the .resx properties as public access modifiers and am able to access these properties in the controller files or other .cs files in the web app. My question is this: Is it possible to access the name/value pairs within my view page? I'd like to do something like this...

text="<%$ Resources: Namespace.ResourceFileName, NAME %>"  

or some other similar method in the view page.

like image 783
SaaS Developer Avatar asked Feb 04 '26 21:02

SaaS Developer


2 Answers

<%= Resources.<ResourceName>.<Property> %>
like image 117
Mike Becatti Avatar answered Feb 06 '26 11:02

Mike Becatti


Expose the resource property you want to consume in the page as a protected page property. Then you can just do use "this.ResourceName"

like image 38
Joel Martinez Avatar answered Feb 06 '26 11:02

Joel Martinez