I am not so familiar with java Script, for that reason I need your help and advice!! I have the following code in my asp button when is clicked. When the confirm box is displayed the user has two choices either to select OK or Cancel. The following code works in both of cases either OK or Cancel.
protected void cancel_Click(object sender, EventArgs e)
string url = "../../Default.aspx";
ClientScript.RegisterStartupScript(this.GetType(), "callfunction", "confirm('Data is not saved'); window.location.href = '" + url + "';", true);