D
DC Gringo
I have a language selector in a dropdownlist that I want to set a session ID
with. It seems to post and accept the value, but my condition statement
doesn't seem to read the session ID and show me my alternate language code.
Here's my dropdownlist:
<ASP
ROPDOWNLIST ID="ddlLanguageSelection1" RUNAT="server"
AUTOPOSTBACK="True"
ONSELECTEDINDEXCHANGED="ddlLanguageSelection_SelectedIndexChanged"
ENABLEVIEWSTATE="True" FONT-SIZE="8pt">
<ASP:LISTITEM VALUE="en" SELECTED="True">English</ASP:LISTITEM>
<ASP:LISTITEM VALUE="fr">Français</ASP:LISTITEM>
<ASP:LISTITEM VALUE="po">Português</ASP:LISTITEM>
<ASP:LISTITEM VALUE="es">Español</ASP:LISTITEM>
</ASP
ROPDOWNLIST></SPAN></ASP
ANEL>
Sub ddlLanguageSelection_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs)
' set up the session variable for population of dependent list
Dim ddl As DropDownList
ddl = sender
Session("sID") = ddlLanguageSelection1.SelectedItem.Value
End Sub
My trace/debug shows that the value is assigned to the session variable:
-----------------------------
Session Key = sID
Type = System.String
Value = es (which is spanish)
------------------------------
What's happening is that I start with English, then if I select Spanish
(value of "es") it shows Spanish in the dropdownlist, but doesn't give me
Panel2.Visible...it still gives me panel1.Visible as if session("sID") were
still "en". If I change it back to English, then it shows me both panels!!!!
My index.aspx.vb webform has the following code:
------------------------------
If Not Page.IsPostBack Then
Session("sID") = "en"
End If
If Session("sID") = "en" Then
mainHeader1.Panel1.Visible = True
ElseIf Session("sID") = "es" Then
mainHeader1.Panel2.Visible = True
End If
with. It seems to post and accept the value, but my condition statement
doesn't seem to read the session ID and show me my alternate language code.
Here's my dropdownlist:
<ASP

AUTOPOSTBACK="True"
ONSELECTEDINDEXCHANGED="ddlLanguageSelection_SelectedIndexChanged"
ENABLEVIEWSTATE="True" FONT-SIZE="8pt">
<ASP:LISTITEM VALUE="en" SELECTED="True">English</ASP:LISTITEM>
<ASP:LISTITEM VALUE="fr">Français</ASP:LISTITEM>
<ASP:LISTITEM VALUE="po">Português</ASP:LISTITEM>
<ASP:LISTITEM VALUE="es">Español</ASP:LISTITEM>
</ASP


Sub ddlLanguageSelection_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs)
' set up the session variable for population of dependent list
Dim ddl As DropDownList
ddl = sender
Session("sID") = ddlLanguageSelection1.SelectedItem.Value
End Sub
My trace/debug shows that the value is assigned to the session variable:
-----------------------------
Session Key = sID
Type = System.String
Value = es (which is spanish)
------------------------------
What's happening is that I start with English, then if I select Spanish
(value of "es") it shows Spanish in the dropdownlist, but doesn't give me
Panel2.Visible...it still gives me panel1.Visible as if session("sID") were
still "en". If I change it back to English, then it shows me both panels!!!!
My index.aspx.vb webform has the following code:
------------------------------
If Not Page.IsPostBack Then
Session("sID") = "en"
End If
If Session("sID") = "en" Then
mainHeader1.Panel1.Visible = True
ElseIf Session("sID") = "es" Then
mainHeader1.Panel2.Visible = True
End If