I want to automatically Enabled Textbox when selected Index 0 in DropDownList.
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged">
I used the previous code, but it does not work and if I write it in a command, it works
protected void OnSelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedIndex == 0)
{
TextBox2.Enabled = false;
}
else
{
TextBox2.Enabled = true;
}
}