Jquery调用控制器方法

famerlican 2012-03-08 10:05:35
请问,Jquery怎样调用Controller中的方法
...全文
121 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
famerlican 2012-03-08
  • 打赏
  • 举报
回复
如果这么写,错误提示是未定义
$.ajax({
type: "post",
url: "/Duty/GetDutyUp?DutyID=" + dutyid,
datatype: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
alert(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}

});

后台方法
public static string GetDutyUp(int DutyID)
{
DutyAppService.GetDutyUp(DutyID);
return "";
}
leon_tj2002 2012-03-08
  • 打赏
  • 举报
回复
多谢分享

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧