Posted on: 10/31/2012 1:42:24 AM | Views : 275

I am trying to add a textboxs to a placeholder control everytime the end user selectes *yes* in a drop down box (via AJAX POSTBACK). The problem I am running into is that only one box gets added, so if the user says "Yes" one box is generated fine but if the user wants to add another one and says yes again no mor boxes get added.
protected void ddlAddCustom_SelectedIndexChanged(object sender, EventArgs e) { if (ddlAddCustom.SelectedValue.ToString() == "Yes") { ddlAddCustom.SelectedValue = "No"; int ControlCount = phNewCustomInfo.Controls.Count; phNewCustomInfo.Controls.Add(DynamicControlCreator.TextBox("tbNewInfo" + ControlCount, false, 0, 0)); } } public static TextBox TextBox(string TextBoxID, bool IsMultiline, int Columns, int Rows) { TextBox NewTextBox = new TextBox(); NewTextBox.ID = TextBoxID; if (IsMultiline == true ...

Go to the complete details ...