Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access My.Resources in .aspx?

I have a string resource I can access in my code behind like so:

My.Resources.SomeStringResource

But if I try to access it in the .aspx like this:

<a href="http://someurl.com"><%=My.Resources.SomeStringResource %></a>

It does not compile. It seems My.Computer, My.Log, My.Request and some others are available but not My.Resources.

Is what I am trying to do possible?

like image 252
Sarah Avatar asked Feb 09 '23 19:02

Sarah


1 Answers

Change the resource access modifier to "Public" in the *.RESX file:

enter image description here

and then access in the code-front like so:

<%= WebApplication1.My.Resources.Resource1.String2%>
like image 155
laylarenee Avatar answered Feb 15 '23 22:02

laylarenee