What's the proper way to combine jQuery modal dialogs and ASP.net server side events?
<p>I'm new to jQuery and I want to do this simple thing in a ASP.Net application:</p>

<p>I have a button in the the form and which when clicked I want to execute some server side code. BUT I want the user confirmation first, given through a jQuery modal dialog.</p>

<p>Which of the following approaches is correct:</p>

<p><strong>1)</strong> Put the ASP.Net button (server control who's <code>OnClick</code> is linked to the server side event) in the form and use jQuery to open the dialog when clicked:</p>

<pre><code>&lt;script ...&gt;
    $(document).ready(function ()
    {
        $("#ConfirmDialog").dialog(
        {
            autoOpen: false,
            modal: true,
            buttons: {
                'Yes': function () { return true; },
                'No': function () { return false; }
            }
        });

        $("#&lt;%= SubmitButton.ClientID %&gt;").click(function (event) {
            event.preventDefault();
            $("#ConfirmDialog").dialog('open');
        });
    });
&lt;/script&gt;
...
&lt;div id="ConfirmDialog"&gt;&lt;/div&gt;
...
&lt;asp:Button ID="SubmitButton" runat="server" 
        Text="Submit" OnClick="Submit_Click" /&gt;
</code></pre>

<p><strong>2)</strong> Put the ASP.Net Button (server control) in the div used as the confirmation dialog and put a HTML button (non server control) in the form for the user to click.</p>

<pre><code>&lt;script ...&gt;
    $(document).ready(function ()
    {
        $("#ConfirmDialog").dialog(
        {
            autoOpen: false,
            modal: true
        });

        $("#SubmitButton").click(function (event) {
            $("#ConfirmDialog").dialog('open');
        });
    });
&lt;/script&gt;
...
&lt;div id="ConfirmDialog"&gt;
    &lt;asp:Button ID="SubmitButton" runat="server" 
            Text="Yes" OnClick="Submit_Click" /&gt;        
    ...
&lt;/div&gt;
...
&lt;input id="SubmitButton" type="button" value="Submit" /&gt;
</code></pre>

<p>I'm going with the first approach but can't make it work, is it ok to do <code>event.PreventDefault()</code> and then just <code>return true;</code> in the Yes button?</p>
