刷新重复提交!respons.write()丢失CSS!

刷新重复提交!解决办法!
 Page_Load()

初始化函数
先设置一个session
if( Session("ok") = "True"
}
 Btn_Click
{
   If ( Session("ok") = True")                   
{
这里执行相关操作

}
 Else
{
Response.Write("<script language='javascript'>alert('不能重复提交!');</script>")
}
Session("ok") = "false"

}

 
Response.Write("<script language='JavaScript'>alert('添加成功!');window.location=window.location.href;</script>");

//  MessageBox("opsuccess", "恭喜,成功!"); 调用!!
  #region  弹出消息的方法
    public void MessageBox(string strKey, string strInfo)
    {
        if (!ClientScript.IsClientScriptBlockRegistered(strKey))
        {
            string strjs = "alert('" + strInfo + "');";
            ClientScript.RegisterClientScriptBlock(this.GetType(), strKey, strjs, true);
        }
    }
    #endregion


posted @ 2008-04-22 10:56  barney  阅读(326)  评论(0编辑  收藏  举报