|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
LocalizationI'm trying to build a master-detail website that uses localisation. It works quit fine, based on the settings in IE. I'm using <globalization culture="auto" uiCulture="auto"/> in the web.config. The default language is show in my menu's. I want to add a dropdownlist to the master that sets the language if the user wants. I've added the following code to the Master Imports System.Threading Imports System.Globalization Partial Class main Inherits System.Web.UI.MasterPage Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then If cboLanguages.Items.Count = 0 Then cboLanguages.Items.Add(CultureInfo.CreateSpecificCulture("en").NativeName) cboLanguages.Items(0).Value = "en" cboLanguages.Items.Add(CultureInfo.CreateSpecificCulture("nl").NativeName) cboLanguages.Items(1).Value = "nl" End If cboLanguages.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name End If End Sub Protected Sub cboLanguages_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboLanguages.SelectedIndexChanged If Not IsNothing(cboLanguages.SelectedValue) And cboLanguages.SelectedValue <> "" Then Label1.Text = CultureInfo.CreateSpecificCulture(cboLanguages.SelectedValue).NativeName Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cboLanguages.SelectedValue) Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture End If End Sub End Class The dropdown is build up correctly, the IE default is shown, but whenever I change the dropdown (code is fired) than Label1 gets the new choosen Culture, but the culture for the website is still my default. Also the menu in the master is not changed. Who can give me any clues? Thanks Victor -- -- Victor Heijke Microsoft Certified Professional Software architect at Flores Automatisering Amsterdam, the Netherlands http://www.flores.nl
[NEWBIE] Call an event from a javascript
UPS LandedCost webservice and ASP.NET 1.1 ASP.NET 2.0 static variables in Global.asax web net app and Atlas questions How to get the user name after FormAuthentication SharpForge - Open source C#/SourceForge implementation insert a value in this way: <%# var %> Cannpot seem to add a reference in Visual Studio 2005 SIMPLE USER CONTROL PROBLEM VS.NET 2003 + IIS 5.1 - A connection with server could not be established |
|||||||||||||||||||||||