473,322 Members | 1,671 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,322 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 1697
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.