accessing a resource file using asp.net
how to access resource file using asp.net framework?? what is the code to access reso开发者_JS百科urce file from default.aspx?? where it is to be inserted? please tell me the steps precisely? thanks!!
You can use the following command:
this.GetGlobalResourceObject("YourclassName", "Yourresourcekey");
or
if the Resource is in the Project as a Resource file.
you do something like:
var o = MyProject.Resource1.Setting;
where MyProject is the ProjectName, and the Resource1 is the name of the Resource inside the project.
So, this is the code-behind way of accessing the resource. How to access a resource (which is in the Project) from an aspx page.
I've tried the implicit and explicit techniques: by using meta:keywords="Yourresourcekey", and <%$ Resources:ClassName, Keyword %>
精彩评论