读书人

MVC3异步调用有关问题

发布时间: 2012-10-10 13:58:11 作者: rapoo

MVC3异步调用问题
onExpandRow: function (index, row) {
$('#ddv-' + index).datagrid({
url: '@Url.Action("Pos", "Resume")'


[HttpPost]
public JsonResult Pos()
{
int total = 0;
int resumeID=10057;
List<PositionResume> posresumes = new List<PositionResume>();
posresumes = posresumeService.GetPositionResumsList(resumeID, ref total);


Dictionary<string, object> json = new Dictionary<string, object>();
json.Add("total", total);
json.Add("rows", posresumes);

return Json(json, JsonRequestBehavior.AllowGet);
}


以上异步调用能运行到JsonResult Pos(),可为以下什么异步调用却运行不到JsonResult Pos(int resumeID)呢?

onExpandRow: function (index, row) {
$('#ddv-' + index).datagrid({
url: '@Url.Action("Pos", "Resume")/' + row.resumeID,


[HttpPost]
public JsonResult Pos(int resumeID)
{
int total = 0;
List<PositionResume> posresumes = new List<PositionResume>();
posresumes = posresumeService.GetPositionResumsList(resumeID, ref total);


Dictionary<string, object> json = new Dictionary<string, object>();
json.Add("total", total);
json.Add("rows", posresumes);

return Json(json, JsonRequestBehavior.AllowGet);
}


[解决办法]
onExpandRow: function (index, row) {
$('#ddv-' + index).datagrid({
url: '@Url.Action("Pos", "Resume")?resumeID=' + row.resumeID,

读书人网 >asp.net

热点推荐