jquery ajax pos,jQuery AJAX post receives 405 error (HTTP verb POS

I have the following jQuery post to an ASP.NET webmethod:

$.ajax({

type: "POST",

url: "AjaxWebMethods.aspx/UpdNote",

contentType: "application/json; charset=utf-8",

data: "{'ID' : '" + id + "', 'note' : '" + note + "' }",

dataType: "json",

success: UpdNote_Success,

error: AjaxError

});

And the web method is declared:

[System.Web.Services.WebMethod(enableSession: true)]

public static int UpdNote(int ID, string note) {

// business logic that eventually returns a number, but simplifying

// ... for the sake of brevity

int retNum = 99;

return retNum;

}

The jQuery post and the web method both work wonderful in a Windows Authenticated environment (ie - users are authenticated by LDAP). However, I recently had to move the website to a server that uses RSA (two-factor authentication, pin and token code) for authenticating users in order to gain access to the site. And what I'm seeing now is that all my jQuery posts are returning "405 error".

Cross-site requests comes to mind, obviously, but none of that is going on here. All of the jQuery AJAX posts are using web methods that are declared in the AjaxWebMethods.aspx, which page resides in the site's own domain.

Thanks in advance for any help or suggestions!

EDIT:

Using Fiddler in IE8 gives me a little more information. The error code that it returns is still 405, but the server error is more descriptive. The server error is "The HTTP verb POST used to access path '/AjaxWebMethods.aspx/UpdNote' is not allowed."

I did try changing the type parameter of the ajax request to GET, but I get a 404 instead (The resource cannot be found).

Also, forgot to mention that this is over SSL (although I don't expect this would make a difference).

EDIT:

After extensive testing (and extensive help from the astute members of stackoverflow) I've determined that 405 error is directly related to the Application Pool that the website is using, and more specifically to the Managed Pipeline Mode that is selected for the Application Pool.

If I use an Application Pool that targets v4.0 (.NET Framework) and Integrated (Managed Pipeline Mode) then my AJAX post works just fine. But if I use an Application Pool that targets v4.0 and Classic (Managed Pipeline Mode) then I get the 405 error.

So at this point I'm still looking for a solution to this question, although I've been able to home-in on the problem.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值