Thursday, May 21, 2009

Localization

To specify the culture (language basis to load the text) follow the below steps:

Default Folder which it's get creat by vs.net

App_GlobalResources

1)Create a resource file (Contactus.resx) it is common for English. based on the langeuage needs to specify the culture text name like (Contactus.it.resx- for itally,Contactus.de.resx - for detuch)
how ever the label's specify
2)
void Loadtext()
{
lblfname.Text = Resources.Contactus.lblfname;
lblsurname.Text = Resources.Contactus.lblsname;
lblemail.Text = Resources.Contactus.lblemail;
lblGender.Text = Resources.Contactus.lblgender;
lblphone.Text = Resources.Contactus.lblphone;
}

3) Call the above method on your page load event. based on the culture it's read from the App_GlobalResources.

Copyright © 2009 Angel