我下面写的测试时有效果,但是传到服务器上就没用了或者哪位大大有更好的方法 请教!!!!flink.aspx里的:                HttpCookie cookie = Request.Cookies["time"];
                if (cookie != null)
                {
                    if (DateTime.Compare(Convert.ToDateTime(cookie.Value), DateTime.Now) < 30)
                    {
                        Response.Write("禁止在30秒内连续提交");
                    }
                }
                else
               {
                    Response.Cookies["time"].Value = DateTime.Now.ToString();
                            Response.Cookies["time"].Expires = DateTime.Now.AddSeconds(30);
                            Response.Write("<script>alert('申请成功'),window.location.replace('test.htm');</script>");
                  }
test.htm里就是一张指向flink.aspx的表单

解决方案 »

  1.   


    btnOK.Attributes.Add("onclick", this.GetPostBackEventReference(btnOK) + ";this.disabled=true;");
    Thread.Sleep(1000);
    btnOK.Style.Remove("disabled");
      

  2.   

     if (DateTime.Compare(Convert.ToDateTime(cookie.Value), DateTime.Now) < 30)
    =========
     if ((DateTime.Now-Convert.ToDateTime(cookie.Value)).TotalSeconds < 30)
    <script>alert('申请成功'),window.location.replace('test.htm');
    ============
    <script>alert('申请成功');window.location.href='test.htm';
      

  3.   

    点击按钮 ,跳出 div 提示 ,完成 ,关闭 div 
      

  4.   

    后来改成Session就行了。。的确是服务器的问题