Dynamically loading user control from current control

Discussion in 'ASP .Net' started by davidr@sharpesoft.com, Sep 11, 2006.

  1. Guest

    Hi,

    I been stuck on this for a week or more. So please help!

    I have a menu were a user can click a button and a user control is
    loaded into the page. A problem occurs when trying to load a user
    control after an event from the CURRENT CHILD USER CONTROL. I put that
    in caps because I need to make clear that the postback event is
    happening from a child user control click button event. So, After the
    Page Load happens on the current page and reloads the current user
    control, it then goes into the page Load for that current user control
    and then it goes into the Click Button event. Inside this Click Button
    event I am use reflection to call a LoadUserControl(controlName) method
    that loads a new user control into the parent page. It is loading this
    control into a panel so that way its always inside the <form> tags.
    Well, I am getting the error "The control must be placed inside a form
    tag with runat=server." Which I don't understand why? I remove the
    current user control before loading in the new one. Is it just not
    possible to load a new user control into the parent page from the
    CURRENT CHILD USER CONTROL?

    Thanks,

    David
     
    , Sep 11, 2006
    #1
    1. Advertisements

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. Eric
    Replies:
    2
    Views:
    919
  2. Replies:
    5
    Views:
    5,049
    Jeremy S.
    Sep 13, 2005
  3. Jamil
    Replies:
    1
    Views:
    2,477
    =?Utf-8?B?SFA=?=
    Nov 24, 2005
  4. Beegee

    Dynamically Loading user control

    Beegee, Jan 14, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    556
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 14, 2006
  5. =?Utf-8?B?cm9kY2hhcg==?=

    dynamically loading my web user control error

    =?Utf-8?B?cm9kY2hhcg==?=, Apr 17, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    387
    =?Utf-8?B?cm9kY2hhcg==?=
    Apr 17, 2007
  6. Divya

    Dynamically loading user control

    Divya, Jun 4, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    267
    John Saunders
    Jun 4, 2004
  7. Travis Pruitt

    Dynamically Adding User Control with Child User Control

    Travis Pruitt, Jan 13, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    290
    Travis Pruitt
    Jan 13, 2005
  8. Phoenix
    Replies:
    2
    Views:
    340
    Teemu Keiski
    Jun 6, 2005
Loading...