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. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.