user206565
user206565

Reputation:

asp.net dropdown list control - dropdown list selected index change event not fired

i have only one item in dropdownlist, so the selected index changed event is not fired. can someone help me in this? Thanks

Upvotes: 0

Views: 1350

Answers (2)

J.Hendrix
J.Hendrix

Reputation: 2199

Not sure of you situation, but you may want to consider adding a "Select One" option

<asp:ListItem value="" text="Select One"/>
<asp:ListItem value="123" text="Item124"/>

Then add some back-end logic to make sure selected index is >0 to make sure your item is selected.

Upvotes: 1

SpaghettiMonster
SpaghettiMonster

Reputation: 620

not sure what you are trying to accomplish, but if you want to only have the one option in the select list, but still want the selected index changed even to be triggered, a cheat could be to add a generic default value like "Select One" or something?

Upvotes: 1

Related Questions