Index value in EventArgs

  • Thread starter Thread starter Jeff
  • Start date Start date
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?
 
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?
 
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?
 
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
 
Back
Top