1.彈出警示對話框
private void btnEdit_Click(object sender, System.EventArgs e)
{
Page.RegisterStartupScript("Startup", "<Script Language=JavaScript> alert('" +"warning!" + "') </Script>");
}
2.彈出確定/取消對話框
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
btnDone.Attributes.Add("onclick","return confirm(/""+"Continue?"+"/");");
}
}
private void btnDone_Click(object sender, System.EventArgs e)
{
//ToDo:.......
}