protected override IAsyncResult BeginExecuteCore(AsyncCallback callback, object state) { string lang = null; HttpCookie languageCookie = Request.Cookies["culture"]; if (languageCookie != null) { lang = languageCookie.Value; } else { string[] userLanguage = Request.UserLanguages; string userLang = userLanguage[0] != null ? userLanguage[0] : ""; if (userLang != "") { lang = userLang; } else { lang = LanguageM.GetDefLanguage(); } } new LanguageM().SetLanguage(lang); return(base.BeginExecuteCore(callback, state)); }
protected override IAsyncResult BeginExecuteCore(AsyncCallback callback, object state) { string lang = LanguageM.GetDefLanguage(); CultureInfo culture = new CultureInfo(lang); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture.Name); return(base.BeginExecuteCore(callback, state)); }