如何自动刷新页面 [英] How to refresh a page automatically

查看:113
本文介绍了如何自动刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想创建一个从SQL 2005数据库中获取数据的ASP.Net页面.由于值的变化,我希望网页每隔几秒钟刷新一次,以便这些值反映在网页中.

请给我一个解决方案

谢谢您

Hi,

I want to create an ASP.Net page that fetch data from SQL 2005 database.As the values varies i want the web page to refresh itself after every few seconds so that those values get reflected in the web page.

Kindly suggest me a solution

thank you

推荐答案

< META HTTP-EQUIV =刷新" CONTENT ="10; URL =您的页面";>
在页面的标题标签中..

[如何在ASP中自动刷新页面. NET ]
<META HTTP-EQUIV="Refresh" CONTENT="10;URL=yourpage";>
in head tag of your page..

[How to refresh a page automatically in ASP.NET]


您可以使用头部的Standard META标签自动刷新页面.
在内容"中,如果您指定URL(此处为http://www.yourURL.com),则在经过特定的延迟(此处为10秒)后,页面将自动重定向到指定的url.如果未指定URL,则它将在间隔后重新加载同一页面.
You can refresh page automatically by using Standard META tag in head section.
In Content if you specify the URL (here http://www.yourURL.com), the page will be automatically redirect to the specified url after specific delay (here it is 10 seconds). If you do not specify the a URL, it will reload the same page after the interval.
<meta http-equiv="Refresh" content="10;URL=http://www.yourURL.com"></meta>



您也可以在代码后面附加meta标签



Also you can append the meta tag from code behind

Response.AppendHeader("Refresh", "10; URL=http://www.yourURL.com")


这篇关于如何自动刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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