generated textboxes in Ajax UpdatePanel

G

Guest

Hi,

I'm using the bellow code to dynamically generate textboxes in my for and it
worked fine:



TextBox textBox = new TextBox();

textBox.ID = id.ToString();

textBox.AutoPostBack = true;

textBox.TextChanged += new EventHandler(userFieldTextBox_TextChanged);

textBox.BorderColor = System.Drawing.Color.Silver;

textBox.BorderStyle = BorderStyle.Solid;

HtmlTableRow tr = new HtmlTableRow();

HtmlTableCell tc1 = new HtmlTableCell();

tc1.Controls.Add(lbl);

tr.Controls.Add(tc1);

tr.Controls.Add(tc2);

textBoxTable.Rows.Add(tr);



but when I did it inside an UpdatePanel its giving me this error:

Cannot unregister UpdatePanel with ID 'MyPanel' since it was not registered
with the ScriptManager. This might occur if the UpdatePanel was removed from
the control tree and later added again, which is not supported.
Parameter name: updatePanel
 

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top