Question

I have three elements which have to be updated every five seconds.

<div id="dLogout"><asp:Button ID="bLogout" runat="server" OnClick="bLogout_Click" Text="Logout" /></div>
    <asp:UpdatePanel runat="server" ID="TimerUpdatePanel" UpdateMode="Conditional" >
        <ContentTemplate>
            <asp:Timer runat="server" id="tTimer" Interval="5000" OnTick="UpdateTimer_Tick" />
            <div id="dLastExport"   runat="server">Last export: {0}</div>
            <div id="dOnSale"       runat="server">On sale: {0}</div>
            <div id="dToBeExported" runat="server">To be exported: {0}</div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="tTimer" EventName="Tick" />
        </Triggers>
    </asp:UpdatePanel>

After this code snippet there are more updatepanels. When the OnTick event is triggered, all updatepanels() seem to update. This causes my webpage to look ugly each 5 seconds. I have only one timer.

How can I specify that only the content between "TimerUpdatePanel" updates?

Best regards

Était-ce utile?

La solution

You can set your updatepanel behaviour. To update with every other udpate panel, or to udpate conditionally.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top