Posts

Showing posts from March, 2008

ASP.Net Localization

To use resources first create Resource files for a page, to generate resources to go Tools - > Generate Local Resources. A resource file for that page will be generated in App_LocalResources Folder, for example if i have generated a file against Default.aspx then a resource file will be generated in App_LocalResources with the name Default.aspx.resx, this will be the default resource file having mapping of all the controls texts in the resource. Now Create other resource file with the value in other language against same keys. eg i want to use arabic and i created a file with the name Default.aspx.ar-EG.resx. now to use this resource file i just have to override InitalizeCulture method and have to set the culture value the code is given below. To set the culture and UI culture for an ASP.NET Web page programmatically   1. Override the InitializeCulture method for the page.   2. In the overridden method, determine which language and culture to set the page to.   3. Set the UI c