How do I change the language of an application in ASP.NET?
I am developing an application with ASP.NET 3.5 and I read that the language the application is shown in is the navigator language.
Is there any way to programmatically select the application language? For example, I want to see an application in English, but my Internet Explorer is in Spanish.
Language is a custom setting saved in the database, so I need to change the language when the user logs in.
a source to share
You can use the CultureInfo class to set the culture for your runtime.
CultureInfo ci = new CultureInfo("en-US", false);
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
a source to share
Are you asking how to change your browser, accept the language? See http://windowshelp.microsoft.com/Windows/en-US/help/7b4a0825-28e2-4929-82f6-1feac4adb6f31033.mspx for instructions for IE 7 and IE 8. The section you want is the Add Language in Internet Explorer "
a source to share
You can also set it in web.config:
<configuration>
<system.web>
<globalization
requestencoding="utf-8"
responseencoding=" utf-8"
fileencoding=" utf-8"
culture="en-US"
uiculture="en-US" />
</system.web>
</configuration>
Or at the page level:
<%@ Page Culture="en-US" UICulture="en-US" ResponseEncoding="utf-8"%>
a source to share