473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

dropdownlist postback to user control

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 ---

<ASP:DROPDOWNLIST 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.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel3.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel5.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel7.Visib le = 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.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel4.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel6.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel8.Visib le = 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
--
_____
DC G
Nov 18 '05 #1
1 1700
DC Gringo wrote:
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 ---

<ASP:DROPDOWNLIST 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.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel3.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel5.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel7.Visib le = 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.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel4.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel6.Visib le = True
famineAlertStatusHeadlinesBySeverity1.Panel8.Visib le = 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

I don't get a clear picture of where you are placing the languageSelect
method. It should be a member of the code behind class; further I don't see
that you are delegating properly.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
1
by: pete | last post by:
Hello all, I'l displaying a dropdownlist inside a datagrid. The problem comes when I try to get the values the user chose on postback. If I rebind the datagrid, the values of the dropdownlist...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
2
by: Dave | last post by:
Hi, I'm building a maintenance form for a table and some of the fields are textboxes (i.e name) and some should be dropdowns (i.e country of origin) When a user clicks 'Edit' in the...
3
by: Lohboy | last post by:
Using ASP.NET and IE7. (Sorry if I am posting in the wrong forum but my problem seemed to be more related to the JavaScript side than the ASP.NET side.) I have two DropDownList controls the...
18
by: Redhairs | last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event during the postback?
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.