Click here to Skip to main content
15,794,202 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
David Mujica5-Oct-16 11:30
David Mujica5-Oct-16 11:30 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
Verdlin6-Oct-16 5:39
Verdlin6-Oct-16 5:39 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
Nathan Minier6-Oct-16 2:17
professionalNathan Minier6-Oct-16 2:17 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
Verdlin6-Oct-16 5:41
Verdlin6-Oct-16 5:41 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
kmoorevs23-Oct-16 7:36
kmoorevs23-Oct-16 7:36 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
Verdlin24-Oct-16 7:42
Verdlin24-Oct-16 7:42 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
kmoorevs24-Oct-16 12:54
kmoorevs24-Oct-16 12:54 
AnswerChange Page Language Pin
Hakmeh Mohannad4-Oct-16 22:43
Hakmeh Mohannad4-Oct-16 22:43 
Hi Everyone

I added change Language button to the master page with the following code

VB
If Session("culture") = "en-US"
Session("culture") = "ar-SA"
else
Session("culture") = "en-US"
End If
Thread.CurrentThread.CurrentCulture = CultureInfo(Session("culture").ToString())
Thread.CurrentThread.UICurrentCulture = CultureInfo(Session("culture").ToString())
Server.Transfare(Request.Url.PathAndQuery)


Also added this code on Page_Init() for master page

VB
If Session("culture") Is Nothing Then
Session("culture") = HttpContext.Current.Request.UserLanguages(0)
End If


also for the controls it is like this

ASP.NET
<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


UPDATE:

i solved by using Global.asax and moved setting culture code into Application_OnAcquireRequestState event

modified 5-Oct-16 6:54am.

Questionimplementation digital signature with md5 hash in asp Pin
Member 127574633-Oct-16 23:28
Member 127574633-Oct-16 23:28 
AnswerRe: implementation digital signature with md5 hash in asp Pin
Nathan Minier4-Oct-16 2:20
professionalNathan Minier4-Oct-16 2:20 
QuestionHow do you hide a label, textbox and button on a form via yes/no toggle switch Pin
Bootzilla333-Oct-16 11:04
Bootzilla333-Oct-16 11:04 
AnswerRe: How do you hide a label, textbox and button on a form via yes/no toggle switch Pin
F-ES Sitecore4-Oct-16 0:27
professionalF-ES Sitecore4-Oct-16 0:27 
AnswerRe: How do you hide a label, textbox and button on a form via yes/no toggle switch Pin
Member 102180524-Oct-16 2:03
Member 102180524-Oct-16 2:03 
QuestionRDLC report header row visiblility issue .. Pin
Member 1178145530-Sep-16 2:59
Member 1178145530-Sep-16 2:59 
Rant[REPOST] RDLC report header row visiblility issue .. Pin
Richard Deeming30-Sep-16 3:22
mveRichard Deeming30-Sep-16 3:22 
QuestionGetting a HARD URL for Your own Action Pin
TheOnlyRealTodd29-Sep-16 21:49
professionalTheOnlyRealTodd29-Sep-16 21:49 
AnswerRe: Getting a HARD URL for Your own Action Pin
F-ES Sitecore30-Sep-16 2:12
professionalF-ES Sitecore30-Sep-16 2:12 
QuestionSum all values in datalist control Pin
Otekpo Emmanuel27-Sep-16 12:49
Otekpo Emmanuel27-Sep-16 12:49 
QuestionRe: Sum all values in datalist control Pin
ZurdoDev29-Sep-16 6:42
professionalZurdoDev29-Sep-16 6:42 
AnswerRe: Sum all values in datalist control Pin
Otekpo Emmanuel29-Sep-16 11:37
Otekpo Emmanuel29-Sep-16 11:37 
GeneralRe: Sum all values in datalist control Pin
ZurdoDev29-Sep-16 13:50
professionalZurdoDev29-Sep-16 13:50 
AnswerRe: Sum all values in datalist control Pin
Vincent Maverick Durano7-Oct-16 9:23
professionalVincent Maverick Durano7-Oct-16 9:23 
Questionchart from datatable in asp.net c# Pin
26s112424-Sep-16 21:53
26s112424-Sep-16 21:53 
AnswerRe: chart from datatable in asp.net c# Pin
Richard MacCutchan25-Sep-16 2:24
mveRichard MacCutchan25-Sep-16 2:24 
GeneralRe: chart from datatable in asp.net c# Pin
26s112425-Sep-16 19:36
26s112425-Sep-16 19:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.