|
hi my friend ,
When Changing the language after logging on the site the language will be changed successfully , but when changing the language by anonymous user , nothing happened , could you check it . it seems that storing the cookies for lang is enough. by the way , I think changing the language to use different resx file is not enough . I suggest to change the current culture as well . I did that by doing the following . add this event to global asax : protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) { //if (HttpContext.Current.Session != null)if (Session["CultureInfo"] != null) string lang = HtmlUIExtensions.GetCultureInfo().Name; System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(lang); } and by putting these two linez in Sys:ChangeLanguage action method System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(lang); in this case the date time format and currency and every thing will be localized this is important for binding validation for example in date format . when dealing with 25/5/2010 in american language it causes error because there is no such 25th month , what do you think my friend regarding the error and regarding my suggestions thanks :) |
|||||||||





















