I added change Language button to the master page with the following code
If Session("culture") = "en-US"
Session("culture") = "ar-SA"
Session("culture") = "en-US"
Thread.CurrentThread.CurrentCulture = CultureInfo(Session("culture").ToString())
Thread.CurrentThread.UICurrentCulture = CultureInfo(Session("culture").ToString())
Also added this code on Page_Init() for master page
If Session("culture") Is Nothing Then
Session("culture") = HttpContext.Current.Request.UserLanguages(0)
also for the controls it is like this
<asp:Label Text="Text" meta:resourcekey="xxx" />
and i added App_LocalResources with 2 files for everypage(one for en and other for ar)
when i click on change language button it works but when move into other view within multiview inside same page language change back into user browser default language, so i have to click on change language button again to change the language
Can someone tell me what wrong with my code
P.S.: I tried with cookies same result
i solved by using Global.asax and moved setting culture code into Application_OnAcquireRequestState event
modified 5-Oct-16 6:54am.