Each time I do a postback, another copy of a control is added to the page!

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Simon Harvey (sh856531_at_microsofts_free_email_service.com)
Date: 10/22/04


Date: Fri, 22 Oct 2004 14:40:34 +0100

Hi everyone,

I'm having a really weird problem with one of my pages. Whenever I hit the
submit button, it reloads the page but another side menu control appears
underneath the original one. This will occur as many times as I hit the
submit button. The thing that I don't understand is that I'm *not* adding
the controls dynamically. The html for the page is very very simple and is
basically the following without the body/head tags etc:

<table width="85%" border="0" cellspacing="0" cellpadding="2">
 <tr>
        <td width="151" valign="top">
            <uc1:sidemenucontrol id="SideMenuControl1"
runat="server"></uc1:sidemenucontrol>
        </td>
        <td>
            <uc1:UserRolesControl id="UserRolesControl1"
runat="server"></uc1:UserRolesControl>
        </td>
 </tr>
</table>

The control that is repeating itself is the SideMenuControl. I don't know
why because it just displays menu elements. Admittedly those elements are
added dynamically but it seems to be that the whole menu is being added each
time, leading me to believe that the problem lies with the (very simple)
containing page.

Can anyone help with this?

I' would be very greatful for any help

Thanks

Simon


Quantcast