selectedIndex is lost during postbacks - ASP.NET

后端 未结 9 1789
北海茫月
北海茫月 2021-01-13 06:35

I have a list box control:




The code behind resembles:

<         


        
9条回答
  •  广开言路
    2021-01-13 07:18

    if your listbox items are same then selected index will get set to 0.To rectify it, set different values to item.value and let item.text remains the same..then selected index will be displayed properly.

提交回复
热议问题