Results 1 to 2 of 2

Thread: Adding dynamic controls

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved 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
  •  



Click Here to Expand Forum to Full Width