|
-
Mar 22nd, 2005, 05:42 PM
#1
Thread Starter
Frenzied Member
Adding dynamic controls
I have always added dynamic controls like so:
Label l = new Label();
l.Text = "Label 1";
this.Controls.Add(l);
on Page_Load. But if I try to add a Button dynamically, I get an error saying it has to be nested in a <form>.
So I checked the HTML source and saw that the items I add dynamically are added below the end </HTML> tag!
How can I add the controls so they're between the <form></form> tags?
Last edited by wey97; Apr 22nd, 2005 at 08:51 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|