Clapy2202
April 18th, 2003, 04:47 PM
I am trying to create a webpage where the user will enter the number of textboxes to be displayed. After that I have to create the textboxes.
I tryed the following code (to create one textbox)
this.Controls.Add(new LiteralControl("< h3 >Value: "));
TextBox box = new TextBox();
box.Text = "0";
this.Controls.Add(box);
this.Controls.Add(new LiteralControl("< /h3 >"));
but in return I recive the following error message:
Control '_ctl0' of type 'TextBox' must be placed inside a form tag with runat=server
Can anyone tell me how I can do that?
I tryed the following code (to create one textbox)
this.Controls.Add(new LiteralControl("< h3 >Value: "));
TextBox box = new TextBox();
box.Text = "0";
this.Controls.Add(box);
this.Controls.Add(new LiteralControl("< /h3 >"));
but in return I recive the following error message:
Control '_ctl0' of type 'TextBox' must be placed inside a form tag with runat=server
Can anyone tell me how I can do that?