Dynamically adding WebUserControl in aspx page

Discussion in 'Software' started by sureshsekaran, Oct 16, 2006.

  1. sureshsekaran

    sureshsekaran

    Joined:
    Oct 16, 2006
    Messages:
    2
    Likes Received:
    0
    Hi

    I have created two web usercontrol and i want to add one during runtime .If i drag web usercontrol and drop in aspx page in design time it works well.But using coding like,

    Control control1 =LoadControl("WebUserControl2.ascx");
    Page.Controls.Add(control1);


    I get error,

    'HiddenField' must be placed inside a form tag with runat=server.
     
    sureshsekaran, Oct 16, 2006
    #1
    1. Advertisements

  2. sureshsekaran

    sureshsekaran

    Joined:
    Oct 16, 2006
    Messages:
    2
    Likes Received:
    0
    Hi Nick!

    I didnt mention 'dynamically created'.I want to add controls dynamically with some condition.

    Do we create dynamic Web User control?

    Thanks for the reply..
     
    sureshsekaran, Oct 18, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.