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?
Jeff - 06 Dec 2007 09:13 GMT
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?
Andrew Morton - 06 Dec 2007 12:33 GMT
> opps, it is the new selectedValue I'm looking for not the
> selectedIndex. AFAIK selectedIndex returns an int but selectedValue
[quoted text clipped - 3 lines]
> 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
Mark Rae [MVP] - 06 Dec 2007 09:58 GMT
> 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?

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net