【发布时间】:2015-05-19 09:11:18
【问题描述】:
[WebMethod(EnableSession = true)]
public static string SaveFavourites(string id, bool check)
{
//My Code here
}
此方法位于动态数据文件夹(DynamicData/CustomePages/Products)中。 我只是触发了对这个方法的ajax调用。
不幸的是,它不起作用。它返回给我“404 Not found”
这是我的 ajax 调用。
$.ajax(
{
type: "POST",
url: "List.aspx/SaveFavourites",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
data: { "id": productID, "chkboxValue": chkboxValue },
success: function (result) {
alert(result);
}
});
请尽快帮忙。
【问题讨论】:
-
你的页面名称是 List.aspx 吗?
-
尝试将 webmethod 参数更改为
SaveFavourites(string id, bool chkboxValue)
标签: c# jquery asp.net dynamic-data asp.net-dynamic-data