Index value in EventArgs

J

Jeff

Hey

ASP.NET 2.0

When the selection in a DropDownList is changed, an
SelectIndexChanged(object sender, EventArgs e) is triggered.

I'm wondering if it is possible to get the new selected index item from the
e argument in this event?

I know I can use for DropDownList1.SelectedIndex, but thought using "e"
would be better

any suggestions?
 
J

Jeff

opps, it is the new selectedValue I'm looking for not the selectedIndex.
AFAIK selectedIndex returns an int but selectedValue returns the selected
value (the value of the valuefield at the selected position in
dropdownlist)...

any suggestions on how to get this SelectedValue from the EventArgs e
argument?
 
M

Mark Rae [MVP]

I'm wondering if it is possible to get the new selected index item from
the e argument in this event?
No.

I know I can use for DropDownList1.SelectedIndex, but thought using "e"
would be better

Why?
 
A

Andrew Morton

Jeff said:
opps, it is the new selectedValue I'm looking for not the
selectedIndex. AFAIK selectedIndex returns an int but selectedValue
returns the selected value (the value of the valuefield at the
selected position in dropdownlist)...

any suggestions on how to get this SelectedValue from the EventArgs e
argument?

It's in the sender, not e.

val=ctype(sender, dropdownlist).selectedvalue

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,125
Latest member
VinayKumar Nevatia_
Top