重新整理重複提交!respons.write()丟失CSS!

來源:互聯網
上載者:User
重新整理重複提交!解決辦法!
 Page_Load()

初始化函數
先設定一個session
if( Session("ok") = "True"
}
 Btn_Click
{
   If ( Session("ok") = True")                   
{
這裡執行相關操作

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

}

2  
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

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.