PDA

View Full Version : confirmation message box (c#)


fogofogo
07-24-2007, 06:03 PM
Hello,

below I have a button, and when its clicked, it displays a message box, asking the user if they are sure that they wish to continue. If they click yes, then db.updateWirePrint(); is supposed to be called. If not, its supposed to do nothing

protected void btnConfirm_Click(object sender, EventArgs e)
{
btnConfirm.Attributes.Add("onclick", "return confirm('Did the Wire Cashins Print ok?');");
db.updateWirePrint();

}

obviously the code above will call db.updateWirePrint(); regardless, so what would I need to do to make sure that is does not run the class if the user hits no?

Thank you