User Control in Master Page
-
Hai, I have a user control in my master page,which shows the company logo based on the language selected from the dropdown in the content page,the logo comes dynamically from different language folders,I update a session variable when I change the language in the dropdown,but when I update the language the user control is not getting refreshed,only reloading the page changes the logo. cheers, Thomas.
-
Hai, I have a user control in my master page,which shows the company logo based on the language selected from the dropdown in the content page,the logo comes dynamically from different language folders,I update a session variable when I change the language in the dropdown,but when I update the language the user control is not getting refreshed,only reloading the page changes the logo. cheers, Thomas.
Hi Thomas, Add following code where you update the Session variable.
Response.Redirect(Request.Url.ToString());
Thanks, Padmanabh Ganorkar
-
Hai, I have a user control in my master page,which shows the company logo based on the language selected from the dropdown in the content page,the logo comes dynamically from different language folders,I update a session variable when I change the language in the dropdown,but when I update the language the user control is not getting refreshed,only reloading the page changes the logo. cheers, Thomas.
what your code ? :confused:
-
Hi Thomas, Add following code where you update the Session variable.
Response.Redirect(Request.Url.ToString());
Thanks, Padmanabh Ganorkar
Hai, if (ddl_language.SelectedItem.Value.ToString() != "0") { HttpCookie cookie = new HttpCookie("viterion_app_language"); cookie.Value = ddl_language.SelectedItem.Text.ToString(); cookie.Expires = System.DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); } From this cookie, the session varible is updated in the master page through the init event. The code is HttpContext.Current.Session.Add("app_language", HttpContext.Current.Request.Cookies["viterion_app_language"].Value); cheers, Thomas.