DropDownList-Items are null on postback

后端 未结 1 875
-上瘾入骨i
-上瘾入骨i 2021-01-28 04:52

I have DropDownList that I have to populate in an event associated with a click event of another control.. the data is populated and present but when I select a value and postba

1条回答
  •  隐瞒了意图╮
    2021-01-28 05:15

    When are you databinding the GridView which is the container of the DropDownList? Do you have wrapped it in a if(!IsPostBack)-check? When you databind the GridView the child controls are always "resetted".

    If you use a declarative databound control like ObjectDataSource you should avoid this.databind() if it's not necessary.

    0 讨论(0)
提交回复
热议问题