DropdownList.selectedIndex always 0 (yes, I do have !isPostBack)

后端 未结 4 1297
萌比男神i
萌比男神i 2020-12-19 10:38

(Scroll down to bottom of post to find solution.)

Got a asp.net page which contains a Datalist. Inside this datalist, there is a template containing

4条回答
  •  心在旅途
    2020-12-19 11:03

    When the DataList is data-bound, the AutoPostBack has not been handled yet, i.e. the values in the ItemCreated event are still the original values.

    You need to handle the SelectedIndexChange event of the dropdown control.

提交回复
热议问题