In this post i will show how to disable a drop down in asp.net using c#.net.Here i have used two drop down lists to perform this task. Whenever the first drop down selected then another drop down will be disabled
Aspx:
Aspx:
<asp:DropDownList ID="ddloption" runat="server" onselectedindexchanged="ddloption_SelectedIndexChanged" AutoPostBack="True"> <asp:ListItem>Please select</asp:ListItem> <asp:ListItem>Hyderabad</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="ddlcode" runat="server" AutoPostBack="True"> <asp:ListItem>Please select</asp:ListItem> </asp:DropDownList>Code :
protected void ddloption_SelectedIndexChanged(object sender, EventArgs e) { ddlcode.Enabled = false; }
No comments:
Post a Comment