How to store Data to Database after the confirmation button if you click Yes the data will be save to database if cancel nothing will happen.
Here’s the code
Page.ClientScript.RegisterStartupScript(
this.GetType(),
"ConfirmBox",
"if(confirm('Are you sure?') == true){window.location='../MyReservation.aspx';};",
true);
it only directs to another page but does not save the data to database.
Thanks in advance to those will answer my question.
Setting
window.locationjust loads a new page.I assume you have a form with the data to save, use jQuery to submit that form:
$('#myForm').submit()instead of settingwindow.location.