我现在有一个CheckBox,当我选择这个CheckBox的时候就定时的刷新当前页面,当我不选的时候就不会自动刷新页面,哪位大侠帮帮忙啊,谢谢了!!!
解决方案 »
- 怎么实现 http://abc.com/用户名
- C#模拟键盘以及中文输入
- 请问如何用JS 验证Repeater内的东东
- 如何计算两点间的最短距离
- 一个简单的问题,送分啦....
- 如何在原asp.net工程内加入ajax控件功能?
- 如何动态释放内存(C#)
- ImageButton的问题!急!!!!!!!!!
- C# 中怎样读XML文件......网上的XML文件节点都是一样多的...我这不一样多
- 网页刷新问题
- |zyciis| 如何将 $("#frmManager [name=CreateTime]").datepicker(); 改为onfocus方法 谢谢
- 怎么将.net framework 3.5 SP1 升级 4.0
onclick调用一个js方法,在js方法里,定时刷新页面。
这是实现整个页面定时刷新的JS
同时需要激发CheckBox的OnCheckedChanged事件 OnCheckedChanged="ChkAll_CheckedChanged"
protected void ChkAll_CheckedChanged(object sender, EventArgs e)
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "opennew", "<script
HTML标记+JS加工下也可以了.
if (document.getElementById("Checkbox1").checked == true) {
var a = setInterval("window.location.href=window.location.href", 5000);
}
else {
clearInterval(a);
}
}
$("#document").ready(function(){
$("#你的单选按钮ID").click(function(){
var a;
a = setTimeOut(function(){
window.lacation.href=window.lacation.href;
},10000)
})
});这个是选中情况下,会10秒后刷新页面,你再判断一下,没选择的时间把他的Settimeout去了就行了。。应该就是这样了</script>
window.lacation.href=window.lacation.href;
else
return
$(document).ready(function(){
$('#checkboxID').toggle(
function(){ var a = setInterval("window.location.href=window.location.href", 5000);
}, //单击第一次执行的 选中
function(){ clearInterval(a);
} //再次点击执行的 不选中
); })
window.setTimeout("location.href= ' ?t="+(Date.parse(new Date()))+"'",1000)