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

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

问题描述

我有一个 ASP 计时器控件,它应该每三分钟运行一次.尽管我将 Timer 控件保留在更新面板中,但它每次运行时都会刷新整个页面.

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

<asp:UpdatePanel ID="UpdatePanel4" runat="server"><内容模板><asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000" ></asp:定时器></内容模板></asp:UpdatePanel>

解决方案

 <asp:Timer runat="server" id="UpdateTimer" interval="200" ontick="function"/><asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional"><触发器><asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick"/></触发器><内容模板><asp:Label runat="server" id="label1"/><asp:TextBox ID="textbox1" runat="server"></asp:TextBox></内容模板></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:Timer runat="server" id="UpdateTimer" interval="200" ontick="function" />

        <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">

            <Triggers>
                <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
            </Triggers>

            <ContentTemplate>
                <asp:Label runat="server" id="label1" />
                <asp:TextBox ID="textbox1" runat="server"></asp:TextBox>
            </ContentTemplate>

        </asp:UpdatePanel>     

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

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