前台用ajax传值,后台为什么取不到
1个回答
展开全部
你后台怎么接收的
_startDate =$("#hid_startetime").val();
_endDate = $("#hid_endtime").val();
$.ajax({
//url: '/XXXXX/Mothe?startdate=' + _startDate + "&enddate=" + _endDate,
url: '/XXXXX/Mothe ',
datatype: 'json',
type: 'post',
data:{startdate:startDate,enddate:endDate}
async: false,
success: function (data) {
});
//后台方法
[HttpPost]
public ActionResult Mothe(string startdate, string enddate)
{
}
_startDate =$("#hid_startetime").val();
_endDate = $("#hid_endtime").val();
$.ajax({
//url: '/XXXXX/Mothe?startdate=' + _startDate + "&enddate=" + _endDate,
url: '/XXXXX/Mothe ',
datatype: 'json',
type: 'post',
data:{startdate:startDate,enddate:endDate}
async: false,
success: function (data) {
});
//后台方法
[HttpPost]
public ActionResult Mothe(string startdate, string enddate)
{
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询