Hi there,
I have an UpdatePanel in my .aspx page. I have a timer control which "ticks" on regular intervals (say, every minute or every 20 seconds) and causes the panel to update (which is specified via the UpdatePanel's Triggers collection).
On the server side, I check whether there have been any changes since last update and whether I need to actually update the panel. If no changes, I don't want the UpdatePanel to flush the same contents to the client browser as it already has. So what I want is kinda "cancel" the UpdatePanel under certain circumstances.
How can I achieve that? Thanks in advance.
Hi,
You should set UpdatePanel.Mode = Conditional, remove all triggers from your UpdatePanel and update your panel programmatically in the tick event.
<atlas:UpdatePanel ID="udp1" runat="server" Mode="Conditional"> <ContentTemplate><%-- Put your content here--%>
</ContentTemplate> </atlas:UpdatePanel> <atlas:TimerControl ID="tc1" runat="server" Interval="60000" OnTick="tc1_Tick" />
protected void tc1_Tick(object sender, EventArgs e){if (ThePanelMustBeUpdated())this.udp1.Update();}
Oh.. right... it's so simple..
Thank you very much
No comments:
Post a Comment