可以先看看效果,被禁用的DropDownList的Items已经无法选取与颜色也变为灰色。
刚开始,DropDownList没有接收从网址传来的参数时,它每一个Item都是可以选取的,一旦接收了值。所对应的DropDownList的item将无法选取而达到禁用。
xxx.aspx:
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</asp:DropDownList>
xxx.aspx.cs:
}