Raise Server side button click event from javascript in ajax call
<p>I have a submit button on a page.</p>

<pre><code>&lt;asp:Button ID="btnSubmit" runat="server" Text="Save Test" OnClick="btnSubmit_Click"
                                        OnClientClick="return ValidateSaveTest(this);" /&gt;
</code></pre>

<p>On Javascript, ValidateSaveTest function is called which validates all the fields.</p>

<pre><code>function ValidateSaveTest(Sender) {

            //do some validation, if fails return false from here. else move forward

        var parameters = {};
        parameters["parametersName"] = $("#" + hidTestId).val();

        var succeededAjaxFn = function(result) {
            if (result== true) {
                var isNewVersion = confirm("Confirmation message");
                if(isNewVersion)
                {
                        //Raise server side button click event. Dont call click side event anymore.
                        $("#" + "&lt;%=btnSubmit.ClientID %&gt;").click();
                }
                return false;
            }

        }
        var failedAjaxFn = function(result) { return false; }

            //jquery ajax call
        CallWebMethod("../Service.asmx", "IsTestUsed", parameters, succeededAjaxFn, failedAjaxFn);

        //async call, always return false hence no postback from here.
        //Need waiting unless ajax response is obtained.
        return false;
    }
</code></pre>

<p>I need to raise server side button click event from javascript once ajax response is received.</p>
