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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top