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

Discussion in 'ASP .Net' started by Tonix, Aug 24, 2004.

  1. Tonix

    Tonix Guest

    This problem was originated by Thanh Nguyen. Your help is appreciated. Thanks.

    The original text is:

    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
    Tonix, Aug 24, 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. Thanh Nguyen
    Replies:
    0
    Views:
    434
    Thanh Nguyen
    Apr 1, 2004
  2. Davide Carboni
    Replies:
    0
    Views:
    350
    Davide Carboni
    Dec 18, 2003
  3. Replies:
    1
    Views:
    1,031
  4. Tonix
    Replies:
    0
    Views:
    167
    Tonix
    Aug 24, 2004
  5. Marc Bogaard
    Replies:
    1
    Views:
    86
    john henry bonham
    Sep 17, 2004
Loading...

Share This Page