我现在有一个CheckBox,当我选择这个CheckBox的时候就定时的刷新当前页面,当我不选的时候就不会自动刷新页面,哪位大侠帮帮忙啊,谢谢了!!!

解决方案 »

  1.   

    这个 checkbox()用html控件就可以。
    onclick调用一个js方法,在js方法里,定时刷新页面。
      

  2.   

    <script language=javascript>setTimeout('self.navigate(""qq.asp"")',10000)</script>
    这是实现整个页面定时刷新的JS 
    同时需要激发CheckBox的OnCheckedChanged事件  OnCheckedChanged="ChkAll_CheckedChanged"
     protected void ChkAll_CheckedChanged(object sender, EventArgs e)
            {
    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "opennew", "<script
      

  3.   

    checkbox服务器控件就可以的呀.
    HTML标记+JS加工下也可以了.
      

  4.   

    前台:<input id="Checkbox1" type="checkbox" onclick="Show();"/>js:function Show() {
                        if (document.getElementById("Checkbox1").checked == true) {
                            var a = setInterval("window.location.href=window.location.href", 5000);
                        }
                        else {
                            clearInterval(a);
                        }
                    }
      

  5.   

    <script>
    $("#document").ready(function(){
       $("#你的单选按钮ID").click(function(){
          var a;
         a = setTimeOut(function(){
          window.lacation.href=window.lacation.href;
          },10000)
       })
    });这个是选中情况下,会10秒后刷新页面,你再判断一下,没选择的时间把他的Settimeout去了就行了。。应该就是这样了</script>
      

  6.   

    if(true)
      window.lacation.href=window.lacation.href;
    else
      return
      

  7.   

    http://hi.baidu.com/dfx2009/blog/item/643d9916eb6e434621a4e944.html
      

  8.   

    我试了一下您的这个,这个就是刷新一次,我的要求就是当我选择了CheckBox之后就定时刷,直到我取消选择CheckBox才停止刷新!!!
      

  9.   

    我能实现定时刷新局部的div么?
      

  10.   


    $(document).ready(function(){
      $('#checkboxID').toggle(
       function(){ var a = setInterval("window.location.href=window.location.href", 5000);
    }, //单击第一次执行的 选中
       function(){ clearInterval(a);
    } //再次点击执行的 不选中
    ); })
      

  11.   

    ajax settimeout定时刷新
    window.setTimeout("location.href= ' ?t="+(Date.parse(new Date()))+"'",1000)