Last post Jan 21, 2009 07:49 AM by shaoyun
Jan 20, 2009 06:33 PM|shaoyun|LINK
I developed a dropdown list for user to select the language so that the web pages can render in a selected language. When the selected value of the dropdown list is changed, the value will be set in the session. In the Global.asax file, the function Application_PostAcquireRequestState
will fetch the value from session and change the current culture information.
If there is no language set in browser, the above function works fine.
However, if the browser has any language setting, the web pages are only changed to the version in the language set in the browser.
Can anybody give me any clue? Thanks
Jan 20, 2009 07:06 PM|shbrat|LINK
Are you setting the CurrentUICulture and CurrentCulture values in Application_BeginRequest?
Jan 21, 2009 03:38 AM|shaoyun|LINK
CurrentUICulture and CurrentCulture are not set in Application_BeginRequest.
They are only set in Application_PostAcquireRequestState.
Jan 21, 2009 07:49 AM|shaoyun|LINK
I just sorted out the problem by putting the setting thread's culture function into the protected override function InitializeCulture() in the page class.