How to work with HttpContext.GetGlobalResourceObject?
I want to use HttpContext.GetGlobalResourceObject for localizing strings in my applica开发者_开发技巧tion, but I am unable to create the xml file, i want to know how should i form my XML resource file so that it can be read from the HttpContext.GetGlobalResourceObject method.
The easiest way is to use Visual Studio to add and edit the resource files.
To add a global resource file to a web project, right-click the project, select Add > Add ASP.NET Folder > App_GlobalResources (if it's not already visible in Solution Explorer).
Then right-click App_GlobalResources folder, select Add > New Item..., then select the Resources File item (.RESX), type in a name and click OK.
Visual Studio will also open the RESX file after adding it to the project, and you can enter resource keys and values from there. No need to get into the XML for basic operations.
If you are interested in the XML structure you can open up the RESX file in a text editor to see the underlying XML format.
精彩评论