ajax 传参进不去

u012764390 2016-04-19 06:36:32


viewl:
function riqikongjian() {
var phonen = $("#phonenumber").val();
var mtime = $("#idate").val();
debugger
// alert(mtime);
$.ajax({
type: "post",
datatype: "json",
url: "BodyComPositionResults/KBTBodyReportPage?PhoneNumber=" + escape(phonen) + "&MemberTime=" + escape(mtime),
success: function (data) })


control:
 
public ActionResult KBTBodyReportPage(string PhoneNumber, string MemberTime)
{
}
...全文
145 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuzuning 2016-04-19
  • 打赏
  • 举报
回复
你的方法是 POST type: "post" 但这是 GET 方法的参数 url: "BodyComPositionResults/KBTBodyReportPage?PhoneNumber=" + escape(phonen) + "&MemberTime=" + escape(mtime), 你需要 url: "BodyComPositionResults/KBTBodyReportPage", data: {PhoneNumber : escape(phonen, MemberTime : escape(mtime)},

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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