ASP定时器控制刷新整个页面? [英] ASP timer Control is refreshing the whole page?

查看:243
本文介绍了ASP定时器控制刷新整个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这应该是每三分钟运行ASP定时器控制。虽然我一直在更新面板Timer控件,它每次运行时刷新整个页面。

有没有只刷新页面的特定部分,而不是整个页面?

 < D​​IV>
        < ASP:的UpdatePanel ID =UpdatePanel4=服务器>
            <&的ContentTemplate GT;
                < ASP:定时器ID =定时器=服务器ontick =Timer1_Tick间隔=300000>
                < / ASP:定时器>
            < /&的ContentTemplate GT;
        < / ASP:的UpdatePanel>
    < / DIV>


解决方案

 < ASP:的UpdatePanel ID =UpdatePanel4=服务器>
   <&触发器GT;
    < ASP:AsyncPostBackTrigger控件ID =定时器事件名称=嘀/>
  < /触发器>
  <&的ContentTemplate GT;
   < ASP:定时器ID =定时器=服务器ontick =Timer1_Tick间隔=300000>< / ASP:定时器>
            < /&的ContentTemplate GT;
        < / ASP:的UpdatePanel>

I have a ASP timer control which is supposed to run every three minutes. Although I kept the Timer control in an update panel, it is refreshing the whole page every time it runs.

Is there any it only refresh the particular section of the page, not the whole page?

<div>
        <asp:UpdatePanel ID="UpdatePanel4" runat="server">
            <ContentTemplate>
                <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000" >
                </asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel>               
    </div>

解决方案

 <asp:UpdatePanel ID="UpdatePanel4" runat="server">
   <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
  </Triggers>
  <ContentTemplate>
   <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000"></asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel> 

这篇关于ASP定时器控制刷新整个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆