【发布时间】:2011-08-05 09:23:52
【问题描述】:
我正在使用 asp.net 表单,我实现了 asp.net 路由,现在我的标准 ajax 调用不起作用。
$.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) {
}
});
但现在我的 url 不是 http://localhost:45027/Users/UserData.aspx 而是 http://localhost:45027/UserSettings 并且我的 ajax 调用不再起作用...我找到了一些答案,但都与 MVC 相关,我无法在我的应用程序中实现它们. 谢谢
【问题讨论】:
-
你试过
http://localhost:45027/UserSettings/GetData吗?不确定它是否会起作用,但如果你这样做了,或者如果你没有尝试过,可能值得说明。 -
我试过了,还是不行:(
标签: jquery asp.net ajax webforms