Q:

Call jqXHR.Abort() from Html.ActionLink

This is my action link:
@Html.ActionLink("View Details", "Details", new { controller = "Patients", id = @Model.Payments.FirstOrDefault().RCMPatientID, acctHistoryRedirect = "acctInfo", defaultPaymentID = @Json.Encode(paymentID) }, new { target = "_blank", @class = "button button--primary button--sm" })

this is my ajax function:
var jqXHR;
    $(function () { 
        var xspinner = new Spinner();
        jqXHR = $.ajax({ /* complete */}) });

Is it possible to call function(){ jqXHR.abort(); } from the action link so that it doesn't run the ajax call when clicked?

A:

In the file with the ajax call, _History.cshtml, I added this at the top:
@{
    string isRedirect = "";
    if (HttpContext.Current.Request.QueryString["acctHistoryRedirect"] != null)
    {
        isRedirect = HttpContext.Current.Request.QueryString["acctHistoryRedirect"].ToString();
    }
}

add the following to the javascript section of the file:
<script>
var isRedirectToAcct = '@isRedirect';
.
.
.
$(function () {

        if (isRedirectToAcct == null || isRedirectToAcct == ''){
            var xspinner = new Spinner();
            $.ajax({ /*complete*/ })
    }
});
.
.
.
</script>

This solved my issue of two ajax calls running that resulted in two loading spinners displaying on the page.

