selectedIndex is lost during postbacks - ASP.NET

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

I have a list box control:




The code behind resembles:

<         


        
9条回答
  •  孤城傲影
    2021-01-13 07:03

    I dont know if it makes a difference or not, but i generally attach my controls to events on the front page rather than in the codebehind. In your example i would have done:

    
    

    Other than that, i would verify that the ViewState is enabled. ViewState can be turned of at the control, page, & even site level.

提交回复
热议问题