Вопрос

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top