Wednesday, January 9, 2013

Disable dropdown list using radio button in asp.net using c#.net

In previous post we have seen how to disable the drop down list using other dropdown list.In the below we will use radio button to disable the drop down list in asp.net using c#.net.For this we have to use radiobutton checked change event
Code behind:
protected void rbcheck_CheckedChanged(object sender, EventArgs e)
{
ddltest.Enabled = false;
}

Aspx:
 <asp:RadioButton ID="rbcheck" runat="server"
 oncheckedchanged="rbcheck_CheckedChanged"  AutoPostBack="true"/>
<asp:DropDownList ID="ddltest" runat="server"
 AutoPostBack="True">
<asp:ListItem>Please select</asp:ListItem>
</asp:DropDownList>

No comments:

Bel