Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SelectedIndexChanged event won't fire for DropDownList

Status
Not open for further replies.

sjthebat

Programmer
Joined
Feb 3, 2005
Messages
1
Location
US
Consider this simple web app:
It contains only a DropDownList, with 4 ListItems.
Code:
Item#   Text    Value
---------------------
 0      dog      pet
 1      cat      pet
 2      rabbit   pet
 3      salmon   fish
Now, I set the AutoPostBack of ddl to True. And let the event-handler for 'SelectedIndexChanged' just write out
the Text for currently selected item.

If you change a type of pet to fish, the 'SelectedIndexChanged' event does get fired. All works well. But if you change items among pets. The event will never be fired. It seems that 'SelectedIndexChanged' event depends on the change of the Value of listitems.

Did I do sth. wrong? Or could someone educate me on this? Thanks!
 
Hmmm you must be doing something wrong as it should change every time the index changes (irrelevant of what the value is).

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top