|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Localization issue with master page.containing a autopostback combobox (XML datasource based) with all the languages my site supports. What should I write (and where, content or master?) so that when the user selects a language, the current page refreshes and displays texts in the new language? All my .resx files are created in advance, for all languages, but I can't figure out how to active them in the new language. I don't want to depend only on browser language settings, but let the user select a language he wants. In the master page, I tried (VB): Page.UICulture = combo_language.Value Page.Culture = combo_language.Value but i see no changes after refresh. In the browser settings, I have deleted all languages in the list, but still no changes after refresh, although language dependent database data are displayed, using code that gets the selected lang, as a session parameter TIA "Savvoulidis Iordanis" <SavvoulidisIorda***@discussions.microsoft.com> az alábbiakat Ãrta a következÅ‘ üzenetben Show quoteHide quote news:D2E469BE-5A1A-414B-B614-F9CC3F6A54F5@microsoft.com... Hi,> Starting to practice localization/globalization, I have a master page > containing a autopostback combobox (XML datasource based) with all the > languages my site supports. What should I write (and where, content or > master?) so that when the user selects a language, the current page > refreshes > and displays texts in the new language? > > All my .resx files are created in advance, for all languages, but I can't > figure out how to active them in the new language. I don't want to depend > only on browser language settings, but let the user select a language he > wants. > > In the master page, I tried (VB): > > Page.UICulture = combo_language.Value > Page.Culture = combo_language.Value > > but i see no changes after refresh. > > In the browser settings, I have deleted all languages in the list, but > still > no changes after refresh, although language dependent database data are > displayed, using code that gets the selected lang, as a session parameter > > TIA Scott Stanfield does what You would like with a simple page in this video : http://www.asp.net/learn/videos/video-40.aspx It could be used as a good starting point. Hope You find this useful. -Zsolt Hi,
To change culture you should override da InitializeCulture Event protected override void InitializeCulture() The problem is that the SelectIndexChangedEvent of the DropDownList in the MasterPage happens after the InitializeCulture of the Content Page. So you cannot use the information. Better then use master pages create a base class that inherits from Page and overrides da InitiCulture Event and then use it as your base class instead of Page; I'll give you a exemple using queryStrings protected override void InitializeCulture() { try { UICulture = Request.QueryString["cult"]; } catch (Exception) { } base.InitializeCulture(); } I hope it helps. Rafael Malheiros "Savvoulidis Iordanis" <SavvoulidisIorda***@discussions.microsoft.com> escreveu na notÃcia da mensagem:D2E469BE-5A1A-414B-B614-F9CC3F6A5***@microsoft.com... Show quoteHide quote > Starting to practice localization/globalization, I have a master page > containing a autopostback combobox (XML datasource based) with all the > languages my site supports. What should I write (and where, content or > master?) so that when the user selects a language, the current page > refreshes > and displays texts in the new language? > > All my .resx files are created in advance, for all languages, but I can't > figure out how to active them in the new language. I don't want to depend > only on browser language settings, but let the user select a language he > wants. > > In the master page, I tried (VB): > > Page.UICulture = combo_language.Value > Page.Culture = combo_language.Value > > but i see no changes after refresh. > > In the browser settings, I have deleted all languages in the list, but > still > no changes after refresh, although language dependent database data are > displayed, using code that gets the selected lang, as a session parameter > > TIA > I already did that. I found out what was wrong. For some reason, the name of
the combo in the request.form collection is not just let's say "combo_language" but "ctl100_combo_language_VI" (I remind I use a masterpage). I don't know what the "_VI" suffix is, but it worked for me. I found that out, looking in the request.form.keys collection. On Jul 1, 11:08 pm, Savvoulidis Iordanis
<SavvoulidisIorda***@discussions.microsoft.com> wrote: > I already did that. I found out what was wrong. For some reason, the name of It's a client id of the nested control.> the combo in the request.form collection is not just let's say > "combo_language" but "ctl100_combo_language_VI" (I remind I use a > masterpage). I don't know what the "_VI" suffix is, but it worked for me. I > found that out, looking in the request.form.keys collection.
Other interesting topics
Web Deployment Project - Publish?
Problem with AddHandler (New CommandEventHandler) under framework 2.0 Disable Validation For Dynamically Created Control Displaying a generated picture in MS Word Image does not fit correctly in a div frame <forms loginUrl="https:// pb C# / VB.NET code which takes a datetime in as parameter and returns a string How to write metainformation in asp.net dll Boundfield display value How to get an https url when using Forms and Default login redirect |
|||||||||||||||||||||||