<%
count=request("id")
%>
<script>
function loadurl()
{
<%if count<10 then%>
location.href="test.asp?id="+<%=count+1%>;
alert(<%=count+1%>);
<%end if%>
}
setTimeout("loadurl()",500)
</script>

解决方案 »

  1.   

    <%
    count=request("id")
    %>
    <script>
    function loadurl()
    {
    <%if count<10 then%>
    location.href="test.asp?id="+<%=count+1%>;
    alert(<%=count+1%>);
    <%end if%>
    }
    setTimeout("loadurl()",500)
    </script>
      

  2.   

    <%
    count=request("id")
    %>
    <script>
    function loadurl()
    {
    <%if count<10 then%>
    location.href="test.asp?id="+<%=count+1%>;
    alert(<%=count+1%>);
    <%end if%>
    }
    setTimeout("loadurl()",500)
    </script>忘了,一定要存为test.asp
      

  3.   

    //使用 js  关键字 :cookie ,timer, setInterval("expression",msc)
    <script id=clientEventHandlersJS language=javascript>
    <!--
    var count=0;
    var timer;
    window.onload =function () {
        if(getcookie("count")!="")
            count = getcookie("count");
        if(count<10){
            timer= window.setInterval("window.document.location.reload()",500)
            count++;
            setcookie("count",count);
    }
        else
        {
            alert("执行了"+count+"次,将停止");
            window.clearInterval(timer);   
        }
    }function getcookie(sName)
    {
      var aCookie = document.cookie.split("; ");
      for (var i=0; i < aCookie.length; i++)
      {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0]) 
          return unescape(aCrumb[1]);
      }
      return null;
    }function setcookie(sName, sValue)
    {
      date = new Date();
      date.setTime(date.getTime()+1000);  //1 second
      document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
    }//-->
    </script>
      

  4.   

    function WindowReload()
    {
      for(var i=0;i<10;i++)
      {
        window.location.reload();
      }
    }
      

  5.   

    刷新其他页的话。function WindowReload(hrefPage)
    {
      for(var i=0;i<10;i++)
      {
        window.location.href=hrefPage;
      }
    }
      

  6.   

    服务器端刷新:
    private void Page_Load(object sender, System.EventArgs e)
    {
      if (Request.QueryString["Id"] == null)
    Response.Redirect("s2.aspx?Id=1");
      else
      {
          if(Int32.Parse(Request.QueryString["Id"])<10)
          Response.Redirect("s2.aspx?Id="+(Int32.Parse(Request.QueryString["Id"])+1).ToString());
       }
    }