自前台js里加个定时器,到20秒刷新一次
window.reload();

解决方案 »

  1.   

    updatepanel的话要配合timer计时器定时刷新。
    你也可以用jquery的ajax来实现。
      

  2.   


    我不要整个页面刷新,我就只要刷新那个gridview啊 。
      

  3.   


        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Timer ID="Timer1" runat="server" Interval="100" ontick="Timer1_Tick">
                </asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel>
        </form>
            protected void Timer1_Tick(object sender, EventArgs e)
            {
                this.TextBox1.Text = DateTime.Now.ToString();
            }这样应该就可以了,把TextBox1换成数据绑定应该就Ok了。
      

  4.   


        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Timer ID="Timer1" runat="server" Interval="100" ontick="Timer1_Tick">
                </asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel>
        </form>
            protected void Timer1_Tick(object sender, EventArgs e)
            {
                this.TextBox1.Text = DateTime.Now.ToString();
            }这样应该就可以了,把TextBox1换成数据绑定应该就Ok了。updatepanel里有一个属性可以设置你可以试下,这样就只刷新updatepanel里的东西了,updatepanel外面你还可以放其他的东西,当刷新数据的时候还不会影响其他的控件。
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
      

  5.   

    用ajax 刷呗$.post("url",{参数},function(d){
             请求完成后,让后台返回JSON  然后丢到控件中
    })ASP.NET的话 应该有特殊的放假可以 刷新绑定控件的值吧。比如说 每 20秒 重新绑定一次 (~ o ~)~zZ
      

  6.   

    ajax每20秒调用一次后台的bind方法