Dynamically adding WebUserControl in aspx page

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

  1. sureshsekaran

    sureshsekaran

    Joined:
    Oct 16, 2006
    Messages:
    2
    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. Advertising

  2. sureshsekaran

    sureshsekaran

    Joined:
    Oct 16, 2006
    Messages:
    2
    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Naga_01
    Replies:
    0
    Views:
    1,402
    Naga_01
    Jun 6, 2006
  2. Hijabi
    Replies:
    1
    Views:
    707
    Headhuntar
    Sep 29, 2006
  3. Armando Ruiz

    default.aspx or login aspx?

    Armando Ruiz, Jun 22, 2004, in forum: MCAD
    Replies:
    0
    Views:
    440
    Armando Ruiz
    Jun 22, 2004
  4. kmurthy7

    problem with the adding jars dynamically

    kmurthy7, Feb 19, 2009, in forum: General Computer Support
    Replies:
    0
    Views:
    836
    kmurthy7
    Feb 19, 2009
  5. getmeaditi
    Replies:
    0
    Views:
    1,713
    getmeaditi
    Mar 10, 2009
Loading...

Share This Page