'ajax request aborted in mvc project

When we try to post json data to server in MVC project, firebug shows that request is aborted.

I believe its fairly of some content when exec is post to iis server request aborted, when we remove exec from textarea request post and data saved fine.

Can anyone face similar kind of issue? We are using jquery 1.7 version.

function PostData(url, methodname, jsondata, callbackfunction) {
    if (jsondata == '') {

        $.ajax({
            type: "POST",
            //async: "true",
            contentType: "application/json",
            dataType: "json",
            url: baseUrl + url + "/" + methodname,
            success: function (html) {
                if (html != null) {
                    if (html.IsSessionExpired != null) {
                        if (html.IsSessionExpired == true) {
                            window.location.href = baseUrl + "/";
                            return;
                        }
                    }
                }

                if (typeof callbackfunction == "function") {
                    callbackfunction(html);
                }
                else {
                    eval(callbackfunction + "(" + JSON.stringify(html) + ")");
                }
            },
            
            error: function (request, status, error) {

            },
            timeout: 300000 // Set timeout of 3 minutes
        });
    }
    else {
            $.ajax({
                type: "POST",
                async: "false",
                contentType: "application/json",
                dataType: "json",
                url: baseUrl + url + "/" + methodname,
                data: JSON.stringify(jsondata),
                success: function (html) {
                    if (html != null) {
                        if (html.IsSessionExpired != null) {
                            if (html.IsSessionExpired == true) {
                                window.location.href = baseUrl + "/";
                                return;
                            }
                        }
                    }

                    if (typeof callbackfunction == "function") {
                        callbackfunction(html);
                    }
                    else {
                        eval(callbackfunction + "(" + JSON.stringify(html) + ")");
                    }
                },
                error: function (request, status, error) {

                },
                timeout: 300000 // Set timeout of 3 minutes
            });
    }
} 

Request aborted in just 2 second. I tried to set timeout but it won't work out.

Is it related to iis setting? Can we set those settings in local environment?



Solution 1:[1]

data: JSON.stringify(jsondata) 

is missing on first call

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TomP