用xmlhttp实现吧.1.在页面放一个hidden,当前页面显示时把客户的设置时间取出来 放进去 2.用以下脚本: //以XML求取数据 function XmlPost() { var webFileUrl = "xxx.aspx" var result = ""; var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP"); xmlHttp.open("POST", webFileUrl, false); xmlHttp.send(""); //取值 result = xmlHttp.responseText; //利用取到的值,用脚本方式对当前页面做提醒动作 ..... //每隔用户设定的分钟数刷新一次. var i = new Number(document.all("hidden1").value); setTimeOut("XmlPost()",i * 1000); }3.在取值页面中,求取用户的提醒事宜,用response.write(""); response.end();方式输出.
2.用以下脚本:
//以XML求取数据
function XmlPost()
{
var webFileUrl = "xxx.aspx"
var result = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlHttp.open("POST", webFileUrl, false);
xmlHttp.send("");
//取值
result = xmlHttp.responseText;
//利用取到的值,用脚本方式对当前页面做提醒动作
.....
//每隔用户设定的分钟数刷新一次.
var i = new Number(document.all("hidden1").value);
setTimeOut("XmlPost()",i * 1000);
}3.在取值页面中,求取用户的提醒事宜,用response.write(""); response.end();方式输出.
难道用<head><meta http-equiv="refresh" content="20"></head>这格式的语句?这个可以在运行的时候会先读数据库,再把读出的值绑定?回hchxxzx(NET?摸到一点门槛):
xmlhttp过于复杂,有没有其他办法?
<asp:Literal id="myPageRefresh" runat="server"></asp:Literal>
然后在后台代码中向前台写
this.myPageRefresh.Text = "<meta http-equiv=\"refresh\" content=\"" + SetTime + "\">";这样可以达到刷新的目的
在后台代码里把从数据库里读出要刷新的时间赋值给Session["refreshTime"]