刪除確認、警告視窗

摘要:刪除確認&警告視窗


//刪除確認:
        btn.Attributes.Add("onclick", "javascript:return confirm('確定要刪除?" + "');");

//彈出警告視窗
//寫法1:
        Response.Write(" <script language=JavaScript> alert( ' 訊息內容 '); </script> ");
//寫法2:
        string info = "<script>alert(' 訊息內容 ');</script>";
        Page.ClientScript.RegisterStartupScript(this.GetType(), "info", info);