Using Resource Files in SharePoint MasterPages
I was unable to figure out how to use strings from resource files (resx) in master SharePoint pages.
I know how to use it with server controls, but can I somehow extract the value and use it in the generalt html. That is, in the alt attribute in the img tag?
<img src="photo.jpg" alt="my_resource_entry_here" />
0
a source to share
3 answers
The easiest way is to add the runat = "server" attribute to your alt tag. This will solve your problem and you can use the "normal" way to obtain resources. Othwerwise use this syntax to get value from resx file locations in App_Global resources:
<img src="photo.jpg"
alt='<%=this.GetGlobalResourceObject("Global", "Mystring").ToString()%>'
0
a source to share