<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="SelectedIndexChanged">
<asp:ListItem Value="Value 1" Text="Value 1" />
<asp:ListItem Value="Value 2" Text="Value 2" />
<asp:ListItem Value="Value 3" Text="Value 3" />
<asp:ListItem Value="Value 4" Text="Value 4" />
<asp:ListItem Value="Other" Text="Other" />
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server" />
</div>
</form>
</body>
public void SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList dropDownList = (DropDownList)sender;
if (dropDownList.SelectedValue == "Other")
{
TextBox1.Enabled = true;
TextBox1.Text = string.Empty;
}
else
{
TextBox1.Enabled = false;
TextBox1.Text = dropDownList.SelectedValue;
}
}