Adding child control to dropdownlist control
Hello,
I need to add child control(a textbox) based on the selected value of the dropdown list.I have done something like
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(DropDownList1.SelectedIndex==4)
{
TextBox txt = new TextBox();
DropDownList1.Controls.Add(txt);
}
}
The above code gives the error saying,
'System.Web.UI.WebControls.DropDownList' does not allow child controls.
Any Help..?????
Thanks
Regards,
Soumya