D
DC Gringo
Using code-behind, I have a page "index.aspx" that has a user control
mainHeader.ascx (with a language selection dropdownlist).
Upon selecting a language from the dropdownlist, it should post back
OnSelectedIndexChanged to a Sub "languageSelect" in the index.aspx.vb
code-behind. The variable should then determine which panels are hidden and
which visible.
I get a "compilation error: 'languageSelect' is not a member of
'ASP.mainHeader_ascx'." If I put Sub "languageSelect" in the
mainHeader.ascx, I get a bunch of undeclared classes when I try to build it
(there are several user controls within the mainHeader user control).
--- HERE'S MY DROPDOWNLIST ---
<ASPROPDOWNLIST ID="ddlLanguageSelection1" RUNAT="server" FONT-SIZE="8pt"
ENABLEVIEWSTATE="True" ONSELECTEDINDEXCHANGED="languageSelect"
AUTOPOSTBACK="True">
--- HERE'S MY SUB languageSelect
Public Sub languageSelect(ByVal sender As System.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
If Session("sID") = "en" Then
'If langID = "en" Then
mainHeader1.Panel1.Visible = True
mainHeader1.panel3.Visible = True
mainHeader1.Panel5.Visible = True
mainNav1.panel1.Visible = True
sectionHeader1.Panel1.Visible = True
sectionHeader1.Panel3.Visible = True
sectionHeader1.Panel5.Visible = True
executiveBriefHeadlines1.Panel1.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel1.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel3.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel5.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel7.Visible = True
specialReports1.Panel1.Visible = True
specialReports1.Panel3.Visible = True
weatherHazards1.Panel1.Visible = True
weatherHazards1.Panel3.Visible = True
weatherHazards1.Panel5.Visible = True
weatherHazards1.Panel7.Visible = True
weatherHazards1.Panel9.Visible = True
imagery1.Panel3.Visible = True
planningAndResponse1.Panel1.Visible = True
livelihoods1.Panel1.Visible = True
'ElseIf langID = "es" Then
ElseIf Session("sID") = "es" Then
mainHeader1.Panel2.Visible = True
mainHeader1.Panel4.Visible = True
mainHeader1.Panel6.Visible = True
mainNav1.Panel2.Visible = True
sectionHeader1.Panel2.Visible = True
sectionHeader1.Panel4.Visible = True
sectionHeader1.Panel6.Visible = True
executiveBriefHeadlines1.Panel2.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel2.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel4.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel6.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel8.Visible = True
specialReports1.Panel2.Visible = True
specialReports1.Panel4.Visible = True
weatherHazards1.Panel2.Visible = True
weatherHazards1.Panel4.Visible = True
weatherHazards1.Panel6.Visible = True
weatherHazards1.Panel8.Visible = True
weatherHazards1.Panel10.Visible = True
imagery1.Panel4.Visible = True
planningAndResponse1.Panel2.Visible = True
livelihoods1.Panel2.Visible = True
End If
End Sub
mainHeader.ascx (with a language selection dropdownlist).
Upon selecting a language from the dropdownlist, it should post back
OnSelectedIndexChanged to a Sub "languageSelect" in the index.aspx.vb
code-behind. The variable should then determine which panels are hidden and
which visible.
I get a "compilation error: 'languageSelect' is not a member of
'ASP.mainHeader_ascx'." If I put Sub "languageSelect" in the
mainHeader.ascx, I get a bunch of undeclared classes when I try to build it
(there are several user controls within the mainHeader user control).
--- HERE'S MY DROPDOWNLIST ---
<ASPROPDOWNLIST ID="ddlLanguageSelection1" RUNAT="server" FONT-SIZE="8pt"
ENABLEVIEWSTATE="True" ONSELECTEDINDEXCHANGED="languageSelect"
AUTOPOSTBACK="True">
--- HERE'S MY SUB languageSelect
Public Sub languageSelect(ByVal sender As System.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
If Session("sID") = "en" Then
'If langID = "en" Then
mainHeader1.Panel1.Visible = True
mainHeader1.panel3.Visible = True
mainHeader1.Panel5.Visible = True
mainNav1.panel1.Visible = True
sectionHeader1.Panel1.Visible = True
sectionHeader1.Panel3.Visible = True
sectionHeader1.Panel5.Visible = True
executiveBriefHeadlines1.Panel1.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel1.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel3.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel5.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel7.Visible = True
specialReports1.Panel1.Visible = True
specialReports1.Panel3.Visible = True
weatherHazards1.Panel1.Visible = True
weatherHazards1.Panel3.Visible = True
weatherHazards1.Panel5.Visible = True
weatherHazards1.Panel7.Visible = True
weatherHazards1.Panel9.Visible = True
imagery1.Panel3.Visible = True
planningAndResponse1.Panel1.Visible = True
livelihoods1.Panel1.Visible = True
'ElseIf langID = "es" Then
ElseIf Session("sID") = "es" Then
mainHeader1.Panel2.Visible = True
mainHeader1.Panel4.Visible = True
mainHeader1.Panel6.Visible = True
mainNav1.Panel2.Visible = True
sectionHeader1.Panel2.Visible = True
sectionHeader1.Panel4.Visible = True
sectionHeader1.Panel6.Visible = True
executiveBriefHeadlines1.Panel2.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel2.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel4.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel6.Visible = True
famineAlertStatusHeadlinesBySeverity1.Panel8.Visible = True
specialReports1.Panel2.Visible = True
specialReports1.Panel4.Visible = True
weatherHazards1.Panel2.Visible = True
weatherHazards1.Panel4.Visible = True
weatherHazards1.Panel6.Visible = True
weatherHazards1.Panel8.Visible = True
weatherHazards1.Panel10.Visible = True
imagery1.Panel4.Visible = True
planningAndResponse1.Panel2.Visible = True
livelihoods1.Panel2.Visible = True
End If
End Sub