selectedIndex is lost during postbacks - ASP.NET

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

I have a list box control:




The code behind resembles:

<         


        
9条回答
  •  一个人的身影
    2021-01-13 07:00

    Have you thought about loading the data earlier - e.g. in OnInit event on the page/user control. This occurs before the postback data is loaded and thus before an on-change can be processed? I believe that should work - but you might want to turn off viewstate!

提交回复
热议问题