Switch to full style
You can find discussions, solutions and codes related to ASP.NET
Post a reply

Cant change the culture or UICulture of the content page

Tue Jan 27, 2009 11:25 am

hello

Cant change the culture or UICulture of the content page of master page,

Any language that its not English

thanks

Code:


on the contant page - (not on the master)

protected override void InitializeCulture()
{
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("he-IL");
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("he-IL");

base.InitializeCulture();
}



on the master Page
meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
meta http-equiv="Content-Language" content="he" />

on web config

globalization requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="he-IL" culture="he-IL" />

Global.asax

void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
// set up the thread's culture before the handler executes
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("he-IL");
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("he-IL");
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("he-IL");
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("he-IL");
}
form the Page contant- UICulture: Hebrew (Israel)
../Testing/Iso_Dos.aspx
../Testing/Iso_Logical.aspx
../Testing/Iso_Visual.aspx
../Testing/CodePage.aspx





Re: Cant change the culture or UICulture of the content page

Mon Aug 10, 2009 2:51 am

I was registered at your forum. I have printed the test message. Do not delete, please.
:clapping:

Re: Cant change the culture or UICulture of the content page

Tue Aug 11, 2009 9:28 am

Sometimes you have to change the culture settings of a user control in runtime. Let's say we have to change the language of a login form on user click. Let's say we do not want to and cannot change the culture of the page (e.g. the user control is embedded in a SharePoint page). The first step is to create a Local Resource for the user control (.resx). Now it's possible to change the language dynamically.

Post a reply
  Related Posts  to : Cant change the culture or UICulture of the content page
 Move content to center of the page     -  
 Change and get html content of element     -  
 Change the content of select tag using JQuery     -  
 change the direction of text in your page     -  
 Image Scroller-scrollbar-LINE_UP,LINE_DOWN-PAGE-UP-PAGE-DOWN     -  
 Hide the content of the div     -  
 show the content of set     -  
 check folder content using asp     -  
 lowercase table content     -  
 Read the content from directory     -