protected void LangMenu_MenuItemClick(object sender, MenuEventArgs e) { int languageId = Convert.ToInt32(e.Item.Value); CurrentUserContext.SetCurrentLanguage(languageId); // Redirect page in order to change language Response.Redirect(Request.RawUrl, false); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); int selectedLanguageId; if (int.TryParse(Request.Form["SelectedLanguageId"], out selectedLanguageId)) { CurrentUserContext.SetCurrentLanguage(selectedLanguageId); CurrentLanguage = CurrentUserContext.CurrentLanguage; Redirect(Request.RawUrl); } }