Link to home
Start Free TrialLog in
Avatar of cnxmax
cnxmax

asked on

Request.Form cannot find dropdownlist on TabContainer.TabPanel

I call  InitializeCulture (override, see code from VB codebehind) as the result of a selectedIndex change from a dropdownlist.  When the DropDownListLanguage control  is placed on the web page it works fine.  When the DropDownListLanguage control is moved to tabpanel 0 of a AJAX toolkit tabcontainer the Request.Form can no longer find it and the culture is not intialized to the newly selected value.  Is there a way for Request.Form to find a dropdownlist when it is placed on a tabpanel of a tabcontainer?  Or any other idea to let me keep DropDownListLanguage control on the tabpanel and still change the culture using an override of InitializeCulture .
Protected Overrides Sub InitializeCulture()
        If Request.Form("DropDownListLanguage") IsNot Nothing Then
            Dim sCulture As String = ""
            Dim selectedLanguage As String = Request.Form("DropDownListLanguage")
            If selectedLanguage = "English" Then
                sCulture = "en-US"
            ElseIf selectedLanguage = "Español" Then
                sCulture = "es-MX"
            Else
                sCulture = "en-US"
            End If

            UICulture = sCulture
            Culture = sCulture
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sCulture)
            Thread.CurrentThread.CurrentUICulture = New CultureInfo(sCulture)
            MyBase.InitializeCulture()
        End If
    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SoLost
SoLost
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cnxmax
cnxmax

ASKER

Great Thanks!