Run C# code after running all javascript codes
<p>I am having a form in which a button is there on click of that button i am calling a javascript function in which i am displaying like 3.. 2.. 1 kind of effect then i am returning true.</p>

<p>But after showing 3 only return true is getting executed and the form is getting submitted.</p>

<p>How to stop form submitting before running the script.</p>

<p>Edit:</p>

<pre><code>function jsFun() 
{ 
    timerCount(3); 
    //Calling the Timer Function. 
} 

var t; 

function timerCount(cDown) 
{ 
    if (cDown == 0) 
    { 
        clearTimeout(t); 
        return true; 
    } 

    $('#&lt;%= mainContainer.ClientID %&gt;').html(cDown); 
    cDown = cDown - 1; 
    t = setTimeout('timerCount(' + cDown + ')', 1000); 
} 

&lt;asp:Button ID="btnStarts" runat="server" Text="Start" OnClientClick="return jsFun();" OnClick="btn_click" /&gt;
</code></pre>
