Implementing INamingContainer Interface for UpdatePanel?

Even in trying to find an answer to this problem, I haven't found any clear explanation (especially one not discussing GridViews) on how to resolve the following error I receive when running a program with an UpdatePanel:

Message: Control with ID 'lblDisplay' being registered through RegisterAsyncPostBackControl or RegisterPostBackControl must implement either INamingContainer, IPostBackDataHandler, or IPostBackEventHandler.

The UpdatePanel is:

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager> <asp:UpdatePanel ID="up1" UpdateMode="Conditional" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="lblDisplay" eventname="Load" /> </Triggers> <ContentTemplate> <asp:HiddenField ID="hiddenZone" runat="server" /> <asp:HiddenField ID="hiddenZone2" runat="server" /> <div style='width: 150px;position:absolute; margin-left: 0;text-align:center;'> <span id="clock" style='font-size:125%;'></span> <asp:Label ID="lblDisplay" runat="server" Text=""></asp:Label></div> <div style='width:150px;position:absolute;margin-left:150px;text-align:center;text-transform:capitalize;'> <asp:Label ID="lblDisplay2" runat="server" Text="" Interval="5000" ontick="tick"></asp:Label> </div> </ContentTemplate> </asp:UpdatePanel> </form>

From my understanding, I have to implement the INamingContainer interface for lblDisplay, but am not quite sure on how to accomplish this. Do I have to databind the UpdatePanel information? Create a new object for INamingContainer?

-------------Problems Reply------------

The problem is that Label does not fire a postback event - it is not interactive. For something to be registered as a PostBackTrigger, it must somehow fire a Postback command - usually in response to some user input - which the UpdatePanel can then intercept. Or the control registered as the trigger must be able to contain controls which fire postback events - e.g. an INamingContainer (for example a Panel). Views:1 Time:2009-07-23

Related post

Copyright (C), All Rights Reserved.

processed in 0.139 (s). 11 q(s)