Client Side Confirm

  • Thread starter Thread starter randy.buchholz
  • Start date Start date
R

randy.buchholz

I want to use a confirm ("Are you sure?") for deletes but can't seem to get
it to work without using built in commands (delete, insert, etc) If I use a
button click event the process continues to execute just as if I hit OK when
the cancel button is clicked.
Why does this happen and how do I implement a confirmation for events?

<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
onclientclick="confirm('Are you sure?')" Text="Button" />

protected void Button1_Click(object sender, EventArgs e)

{

Button1.Text = "OK";

}

No matter which confirm button I click it executes the Button1_Click
 
Back
Top