Page Load fired 3 times Web user control is embedded in a custom control

Discussion in 'ASP .Net Building Controls' started by Thomas Ekegren, Sep 3, 2003.

  1. Hi,

    I have built a custom control that build a table with 3 cells in it. The
    custom control is designed to add all child controls to cell#2, which it
    does like it is supposed to.
    However if I add a web user control inside the custom control, the page_load
    event of the web user control is fired three times! Does anybody know how to
    avoid that the page_load event is fired three times?

    code example:
    ....
    <Custom:CustomTable id="ct1" runat="server" cellpadding="0" cellspacing="0"
    width="100%">
    <tr>
    <td><asp:panel id="pnl" runat="server">
    ...
    </asp:panel>
    </td>
    </tr>
    </Custom:CustomTable>

    .... HERE THE PAGE_LOAD EVENT OF THE WEB USER CONTROL
    <CustomControls:GalleryThumbs> IS FIRED THREE TIMES
    <Custom:CustomTable id="ct1" runat="server" cellpadding="0" cellspacing="0"
    width="100%">
    <tr>
    <td width="100%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td>
    <CustomControls:GalleryThumbs runat="server"
    id="test"></CustomControls:GalleryThumbs>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </Custom:CustomTable>

    Any help would be highly appreciated!

    /Thomas
    Thomas Ekegren, Sep 3, 2003
    #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. Cynic07
    Replies:
    1
    Views:
    460
    Cynic07
    Jul 31, 2003
  2. SammyBar
    Replies:
    1
    Views:
    588
    Erjan Gavalji
    Jul 21, 2009
  3. Fabrizio
    Replies:
    5
    Views:
    220
    Alessandro Zifiglio
    Feb 24, 2004
  4. SammyBar

    Custom event from a custom web control is fired twice

    SammyBar, Jul 14, 2009, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    924
    Erjan Gavalji
    Jul 21, 2009
  5. Num GG
    Replies:
    2
    Views:
    342
    Num GG
    Nov 17, 2008
Loading...

Share This Page