我用的 UpdatePanel 和 Timer 控件实现的时时刷新 可以在数据库数据发生变化时 页面的显示数据发生变化但是怎么能弹出 提醒呢? protected void Timer1_Tick(object sender, EventArgs e)
{
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("SELECT [LOGINNAME], [SEX], [NAME], [ADDRESS] FROM [STAFF] where [ISDELETED]='false'", con);
DataSet ds = new DataSet();
sda.Fill(ds);
con.Close();
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.GridView1.DataBind();
}
这种Js调用也试过
Response.Write("<script defer>go();</script>");
还是不行 弹不出来
那位有好点的办法 个、如果有代码是最好了麻烦您发下吧[email protected]会给您追加分数的 !感激不尽!
{
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("SELECT [LOGINNAME], [SEX], [NAME], [ADDRESS] FROM [STAFF] where [ISDELETED]='false'", con);
DataSet ds = new DataSet();
sda.Fill(ds);
con.Close();
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.GridView1.DataBind();
}
这种Js调用也试过
Response.Write("<script defer>go();</script>");
还是不行 弹不出来
那位有好点的办法 个、如果有代码是最好了麻烦您发下吧[email protected]会给您追加分数的 !感激不尽!
window.refreshNotificationStatus = function (){
$.getJSON("${页面路径}", function(json){
$("span.onlinedw").text(json[0]);
$("span.onlinexf").text(json[1]);
});
setTimeout("refreshNotificationStatus()",10000);
}
refreshNotificationStatus();
});
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "key", confirmJs, true);将要弹出的内容输出到客户端
<div id="divObj"></div>
<input type="button" value="create object" onclick="f();" /> var f = function(){
var divObj = document.getElementById("divObj");
divObj.innerHTML = "";
divObj.innerHTML = "<object data=\"Media/chimes.wav\" type=\"application/x-mplayer2\" width=\"0\" height=\"0\">"
+ "<param name=\"src\" value=\"Media/chimes.wav\" />"
+ "<param name=\"autostart\" value=\"2\" />"
+ "<param name=\"playcount\" value=\"infinite\" />"
+ "</object>";
}此方法兼容ie,ff。
注意事项请参考
http://man.ddvip.com/web/dhtml/objects/param.html扩展信息请参阅
http://www.w3schools.com/media/media_browsersounds.asp