我在每个指向SqlDataSource的webform上都有一些DropDownLists。其中一些数据源使用其中一个DropDownLists作为选择参数,将列表过滤为特定类别。DropDownList的SelectedValue不是我在Enabled = false时选择的值
对于某些用户,这些DropDownLists中的两个将被自动设置和禁用。
当我提交下拉窗口启用它的工作正常,但是当它们被禁用时,DropDownList的SelectedValue被重置为列表中的第一个。
我DropDownLists构造如下:
<asp:DropDownList ID="ddlManager" runat="server" DataSourceID="dsManagers"
EnableViewState="false" DataValueField="ManagerID" DataTextField="MgrName"
AppendDataBoundItems="false" ondatabound="ddlManager_DataBound" >
下拉列表上绑定事件的数据添加额外的项目如下:
protected void ddlManager_DataBound(object sender, EventArgs e)
{
this.ddlManager.Items.Insert(0, new ListItem("--Manager--", "--Manager--"));
}
任何人都可以摆脱任何光线,为什么这正在发生?
谢谢