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);
However, what I am trying to do is to perform an if/then/else statement using javascript inside ClientScript function, and I don't know the correct syntax of that. e.g what I am trying to do is redirect to another pages if the user selects ok or cancel

ClientScript.RegisterStartupScript(this.GetType(), "callfunction",
 "javascript:if(confirm('Data is not saved')== true) {document.location.href = '../../Default.aspx'}; else {document.location.href = '../../Current.aspx'};", true);