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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top