I want to cancel page submit ,on cancel action of confirm using C# in asp.net4.0
<p>I want to stop page submit on cancel action of confirm .</p>

<p>What I want to achive is , I have a form with server validation, if user submit the form without entering any fields, it should validate the form and no confirm window should open.
But now if user have filled all the fields and go on submit the form, It should confirm the page submission (Are you sure you want to create user.),
So on clicking yes it should submit the page .
But on cancel it should cancel the page submission.</p>

<p>My only problem is with the cancel as it is still submitting the form.</p>

<p>my code in javascript is as follows:</p>

<pre><code>function ConfirmSubmit() {
    Page_ClientValidate(); 
    if (Page_IsValid) {
        if(!confirm('Are you sure?'))
        {
            return false;
        }
    }
}

&lt;asp:Button ID="btnSave" runat="server" OnClientClick="javascript:return ConfirmSubmit()" OnClick="btnSave_Click" Text="Save" /&gt;
</code></pre>

<p>I have server code on btnSave_Click.</p>

<p>Please help me , I have tried many things but could not sucesseed</p>

<p>Many thanks..</p>
