.NETGURU
SelectedIndexChanged event not firing correctly
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngvb' list.


Asim Ahmed
I am having problems with the dropdownlist box. When a selection in the =
dropdown box changes, I want to load another dropdownlist box from the =
database based on that selection.=20
For this the only relevant event is the SelectedIndexChanged event. But =
this doesn't seem to fire unless you have another button to reload the =
page. How do you get around that.=20
Should have ben simple. User selects from the first list box, the second =
box loads with data based on his selection. I know its possible. What am =
I missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web =
page
(textbox, and calendars, also labels). The controls are adding =
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below =
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************=20
Eric Landes=20
Senior Programmer/Analyst (Partners Health Plan)=20
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************=20
All statements expressed are my own, and do not reflect the opinion of =
my
employer, unless stated otherwise.=20

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

Reply to this message...
 
    
Bryan Costanich
Have you set AutoPostBack="True" on your DropDownList?

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:47 AM
To: aspngvb
Subject: [aspngvb] SelectedIndexChanged event not firing correctly

I am having problems with the dropdownlist box. When a selection in the
dropdown box changes, I want to load another dropdownlist box from the
database based on that selection.
For this the only relevant event is the SelectedIndexChanged event. But this
doesn't seem to fire unless you have another button to reload the page. How
do you get around that.
Should have ben simple. User selects from the first list box, the second box
loads with data based on his selection. I know its possible. What am I
missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web page
(textbox, and calendars, also labels). The controls are adding correctly.

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text = "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************
Eric Landes
Senior Programmer/Analyst (Partners Health Plan)
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************
All statements expressed are my own, and do not reflect the opinion of my
employer, unless stated otherwise.

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Reply to this message...
 
    
Asim Ahmed
Yes its set to true

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:46 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Have you set AutoPostBack=3D"True" on your DropDownList?

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:47 AM
To: aspngvb
Subject: [aspngvb] SelectedIndexChanged event not firing correctly

I am having problems with the dropdownlist box. When a selection in the
dropdown box changes, I want to load another dropdownlist box from the
database based on that selection.=20
For this the only relevant event is the SelectedIndexChanged event. But =
this
doesn't seem to fire unless you have another button to reload the page. =
How
do you get around that.=20
Should have ben simple. User selects from the first list box, the second =
box
loads with data based on his selection. I know its possible. What am I
missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web =
page
(textbox, and calendars, also labels). The controls are adding =
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below =
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************=20
Eric Landes=20
Senior Programmer/Analyst (Partners Health Plan)=20
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************=20
All statements expressed are my own, and do not reflect the opinion of =
my
employer, unless stated otherwise.=20

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

Reply to this message...
 
    
Bryan Costanich
Post your .aspx code.

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 9:25 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Yes its set to true

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:46 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Have you set AutoPostBack="True" on your DropDownList?

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:47 AM
To: aspngvb
Subject: [aspngvb] SelectedIndexChanged event not firing correctly

I am having problems with the dropdownlist box. When a selection in the
dropdown box changes, I want to load another dropdownlist box from the
database based on that selection.
For this the only relevant event is the SelectedIndexChanged event. But this
doesn't seem to fire unless you have another button to reload the page. How
do you get around that.
Should have ben simple. User selects from the first list box, the second box
loads with data based on his selection. I know its possible. What am I
missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web page
(textbox, and calendars, also labels). The controls are adding correctly.

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text = "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************
Eric Landes
Senior Programmer/Analyst (Partners Health Plan)
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************
All statements expressed are my own, and do not reflect the opinion of my
employer, unless stated otherwise.

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Reply to this message...
 
    
Asim Ahmed
Bryan, thanks for your interest.
Actually this site has the same code, simple format:
http://aspauthors.com/aspnetbyexample/ch06/

Reference 6.4 (third example)
Here as in my case, you need to click on the update button which then =
fires the selecteditemchange event to see the text message in the label.
I want the event to fire and the message to show as soon as the =
selection in the drop down list box is changed.
Again, thanks for your interest.

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 12:40 PM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Post your .aspx code.=20

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 9:25 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Yes its set to true

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:46 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Have you set AutoPostBack=3D"True" on your DropDownList?

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:47 AM
To: aspngvb
Subject: [aspngvb] SelectedIndexChanged event not firing correctly

I am having problems with the dropdownlist box. When a selection in the
dropdown box changes, I want to load another dropdownlist box from the
database based on that selection.=20
For this the only relevant event is the SelectedIndexChanged event. But =
this
doesn't seem to fire unless you have another button to reload the page. =
How
do you get around that.=20
Should have ben simple. User selects from the first list box, the second =
box
loads with data based on his selection. I know its possible. What am I
missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web =
page
(textbox, and calendars, also labels). The controls are adding =
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below =
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************=20
Eric Landes=20
Senior Programmer/Analyst (Partners Health Plan)=20
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************=20
All statements expressed are my own, and do not reflect the opinion of =
my
employer, unless stated otherwise.=20

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

Reply to this message...
 
    
Bryan Costanich
That sample isn't using the AutoPostBack.

put AutoPostBack="True" in the <asp:DropDownList tag.

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 10:57 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Bryan, thanks for your interest.
Actually this site has the same code, simple format:
http://aspauthors.com/aspnetbyexample/ch06/

Reference 6.4 (third example)
Here as in my case, you need to click on the update button which then fires
the selecteditemchange event to see the text message in the label.
I want the event to fire and the message to show as soon as the selection in
the drop down list box is changed.
Again, thanks for your interest.

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 12:40 PM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Post your .aspx code.

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 9:25 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Yes its set to true

Asim

-----Original Message-----
From: Bryan Costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:46 AM
To: aspngvb
Subject: [aspngvb] RE: SelectedIndexChanged event not firing correctly

Have you set AutoPostBack="True" on your DropDownList?

-----Original Message-----
From: Asim Ahmed [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:47 AM
To: aspngvb
Subject: [aspngvb] SelectedIndexChanged event not firing correctly

I am having problems with the dropdownlist box. When a selection in the
dropdown box changes, I want to load another dropdownlist box from the
database based on that selection.
For this the only relevant event is the SelectedIndexChanged event. But this
doesn't seem to fire unless you have another button to reload the page. How
do you get around that.
Should have ben simple. User selects from the first list box, the second box
loads with data based on his selection. I know its possible. What am I
missing here.
Thanks for any help in advance.

Asim

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 8:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web page
(textbox, and calendars, also labels). The controls are adding correctly.

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text = "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************
Eric Landes
Senior Programmer/Analyst (Partners Health Plan)
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************
All statements expressed are my own, and do not reflect the opinion of my
employer, unless stated otherwise.

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Reply to this message...
 
 
System.Reflection.Emit.Label
System.Web.UI.MobileControls.Label
System.Web.UI.WebControls.DropDownList
System.Web.UI.WebControls.Label
System.Windows.Forms.Label




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification