I’ve read some article about globalization in asp.net but some points are not clear for me.
All of this articles are saying that we should add some part in our web.config such as:
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="de-DE" uiCulture="de-DE"/>
</system.web>
and in aspx and aspx.cs too like:
<%@ Page UICulture="de-DE" Culture="de-DE" ....%>
and
using System.Threading;
using System.Globalization;
....
protected void Page_Load(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
//Button1.Text = Resources.Resource1.city;
}
if I want to change the text of lables and etc. I should add Resourse file and some code like this:
Button1.Text = Resources.Resource1.city;
if I delete the configurations from web.config and pageload, above line of code code works fine without problem but why should I add this configuration in web.config, aspxpage and page load?
you must just add in your configuration file in order to generalize for your application. you can delete from yours pages and your code