Consider this simple web app:
It contains only a DropDownList, with 4 ListItems.
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!
It contains only a DropDownList, with 4 ListItems.
Code:
Item# Text Value
---------------------
0 dog pet
1 cat pet
2 rabbit pet
3 salmon fish
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!