Empowering the ASP.Net Button Web Control, Confirm?...

类别:.NET开发 点击:0 评论:0 推荐:

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:.......
   }

 


 

本文地址:http://com.8s8s.com/it/it43719.htm