Click to See Complete Forum and Search --> : Async webform and globalization


dannystommen
December 4th, 2009, 04:10 AM
I have an async webform with globalization.


<%@ Page Async="true" ...



protected override void InitializeCulture() {
string culture = "";

if (Request.QueryString["ci"] != null)
culture = Request.QueryString["ci"];

System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

base.InitializeCulture();
}


In this page, I have a gridview. The datasource of the gridview is some data of a 3th party webservice. This webservice is invoked async. When I open this page with Dutch cultureInfo, I've noticed that all is in Dutch, except the content of the Gridview (except the headers).

After debugging I found out that in the gridview's RowDataBound event the System.Threading.Thread.CurrentThread.CurrentCulture is reset to 'en-US'.

Any idea why this happens and how to prevent this from happening?