开发者

accessing a resource file using asp.net

开发者 https://www.devze.com 2023-02-12 18:59 出处:网络
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!!

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 %>

0

精彩评论

暂无评论...
验证码 换一张
取 消