Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add TextBox To Page
Message
From
25/02/2010 17:27:16
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01451101
Message ID:
01451102
Views:
20
>When I try this:
>
>
>        TextBox TextBox1 = new TextBox();
>        this.Controls.Add(TextBox1);
>
>
>I get a page error "Control 'ctl02' of type 'TextBox' must be placed inside a form tag with runat=server. "
>
>Is there no way to do this in C# in the page_load? Or must I do it with tags?

Your form tag in your page need to be defined in an ASP.NET format instead of a regular HTML format. So, it is something like:
<form id="Form1" method="Post" runat="server" class=Form>
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform