2

I have a webmethod in aspx page and I am calling it through jquery Ajax method.

In one server I am getting windows security prompt on ajax call (all other servers are working fine). When I was checking using fiddler I see a 301 redirect of my method call(webmethods.aspx/GetDetails to webmethods.aspx/GetDetails/)

Not sure why the redirect is happening on one server and call to webmethod.aspx/GetDetails/ is throwing 401. I checked all the wildcard mapping etc and not able to find any issues. Any idea where else I need to check?

Here is my code

 $.ajax({
            type: "POST",
            url: "/webmethods.aspx/GetDetails",
            data: "",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                //alert('success');
            },
            failure: function (response) {
                alert(response);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var errMessage = "An error occured serving your request. Please try again.";
                if (jqXHR)
                    errMessage = $.parseJSON(jqXHR.responseText).Message;
                alert(errMessage);
            }
4

1 回答 1

1

您可以检查您的 web.config 中的处理程序顺序吗?我有类似的问题,静态文件处理程序在 aspx 处理程序之前。更改顺序解决了我的问题(将静态文件作为最后一个元素移动,因为大多数情况下它会在处理之前验证文件是否存在)。

于 2013-05-03T14:05:29.393 回答