Help: Control lost doesn't raise event after being moved to dynamically loaded user control

Discussion in 'ASP .Net' started by Thanh Nguyen, Apr 1, 2004.

  1. Thanh Nguyen

    Thanh Nguyen Guest

    Hi everyone, I'm encountering a very weird problem, I have spent the
    last 3 days trying to figure out how to fix but there is still no
    clue. Here is the problem:

    I define 2 WebUserControls:

    - Content.ascx has a TabStrip control and a Button on it.

    - Box.ascx has a PlaceHolder control on it.

    In the OnInit() event handler, I create a table cell and dynamically
    add the Box.ascx control to the table Cell using LoadControl() method.
    Then I dynamically add the Content.ascx control to the PlaceHolder
    inside the Box.ascx control.

    When the webapp runs, clicking on the Button (in Content.ascx) does
    raise the event, clicking on the TabStrip control (also in
    Content.ascx) does NOT rise the event.

    The weird thing is if I don't use LoadControl() but instead creating a
    Panel control and add the Content.ascx to the Panel control then it
    works fine.

    It seems there is something wrong with dynamic control loading & the
    PlaceHolder but I'm not sure :(

    Could someone please help? Much appreciated!!!

    Thanks
     
    Thanh Nguyen, Apr 1, 2004
    #1
    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. Tonix
    Replies:
    0
    Views:
    423
    Tonix
    Aug 24, 2004
  2. Replies:
    1
    Views:
    1,050
  3. Tonix
    Replies:
    0
    Views:
    177
    Tonix
    Aug 24, 2004
  4. Tom
    Replies:
    0
    Views:
    93
  5. Marc Bogaard
    Replies:
    1
    Views:
    92
    john henry bonham
    Sep 17, 2004
Loading...

Share This Page