开发者

jQuery post redirects to get

I have a simple ajax method in my MVC.Net project which adds entries to a calendar, but when I run the following code:

 sDate = new Date(jQuery(".datepicker").val());
 var args = {  startdate: date.toDateString(), starttime: jQuery('#ddlFrom').val(), endtime: jQuery('#ddlTo').val() };
 var action = "/EventController/AddEvent/";

            jQuery.post(action, args,
                function (response) {
                    console.log(response);
        开发者_StackOverflow社区            if (response == "") {
                        jQuery('#js_divSuccess').show();
                    } else {
                        jQuery('#divError').text(response);
                    }
                });

It first does the following (looking in firebug):

jQuery post redirects to get

Why does it make a redirect on a post?


You must accidentally have the redirect (instead of forward) in that controller API on the server-side.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜