Jquery ajax call with asp.net routing implemented
I'm using asp.net forms and i implemented asp.net routing and now my standard ajax calls don't work.
$.ajax({
type: "POST",
url: "http://localhost:45027/Users/UserData.aspx开发者_如何学编程/GetData",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
//do something with data
},
error: function (textStatus) {
}
});
but now my url is not http://localhost:45027/Users/UserData.aspx but it is http://localhost:45027/UserSettings and my ajax calls don't work anymore... I found some answers but all are related to MVC and i couldn't implement them in my application. Thanks
have you tried requesting the same url in your browser? All an $.ajax POST is doing is making that request as a Form post. Since you have nothing in your data: parameter, maybe it should be a GET request?
精彩评论