How to handle single Ajax Error for Entire page using jquery
<p>In My page i am sending data to server side using 8 ajax call...</p>

<p>I don't want to handle ajax error for each and every ajax call......</p>

<p>Single ajax error handle all the ajax error in entire page....</p>

<p>is their any inheritance is possible for the entire page..</p>

<pre><code> function SendConfirmationEmail(ShipmentID, ChannelOrderReference) {
var Url = '&lt;%=Url.Action("SendShipmentEmail","Shipments") %&gt;';
$.ajax({
    cache: false,
    type: "POST",
    data: 'strOrderShipmentId=' + ShipmentID + '&amp;channelOrderReference=' + ChannelOrderReference,
    url: Url,
    datatype: "HTML",
    success: function (data) {
        if (data == "1") {
            SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Email is successfully sent for Order#' + ChannelOrderReference + '');
        }
        if (data == "-2") {
            SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Email Template is not Choosen for this Store');
        }
        if (data == "-1") {
            SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Problem in Sending Email for Order#' + ChannelOrderReference + '');
        }
        if (data == "0") {
            SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Connection Failed to Send Email for Order# ' + ChannelOrderReference + '');
        }
        if (data == "-3") {
            SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'ShipTo Email Address is Not Given for Order# ' + ChannelOrderReference + '');
        }
        // SucessErrorMessageDisplay('DivStatus', 'lblStatus', 'imgStatus', 0, 'Order# :' + ChannelOrderReference + ' is voided successfully');

    },
    error: function (xhr, ajaxOptions, thrownError) {
        if (xhr.status == 403) {
            window.location.href = '&lt;%: Url.Action( "SessionExpire", "Home" ) %&gt;';
        }
    }
});
</code></pre>

<p>}</p>
