开发者

asp.net dropdown listbox not holding viewstate

开发者 https://www.devze.com 2023-03-26 18:18 出处:网络
I am using VS 2008, VB and using a dorpdown listbox in my asp.net webpage. I select a value from the dropdown, click the submit button, when the page comes back from the server, the value in the dropd

I am using VS 2008, VB and using a dorpdown listbox in my asp.net webpage. I select a value from the dropdown, click the submit button, when the page comes back from the server, the value in the dropdown is blank (default). The dropdown controls viewstate is enabled.

The code for the submit button is:

<asp:Button ID开发者_JS百科="ButtonSubmit" runat="server" Text="Submit" CssClass="Button" />     

The dropdownlist code is:

What am I missing here?


are you binding dropdown in page_load event? If yes move that code in

 if(!page.isPostback)
    {
       binddropdown();
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消