asp.net dropdown list control - dropdown list selected index change event not fired
i have only one 开发者_StackOverflow社区item in dropdownlist, so the selected index changed event is not fired. can someone help me in this? Thanks
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?
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.
精彩评论