【发布时间】:2013-02-26 20:39:41
【问题描述】:
我最难从我的 url 中提取数据并将其放入我的 jqGrid 中的 asp.net MVC4 中。我在这里错过了什么?
$(document).ready(function () {
jQuery("#frTable").jqGrid ({
cmTemplate: { sortable: false },
caption: '@TempData["POPNAME"]' + ' Population',
url: '@Url.Action("GetAjaxPagedGridData", "Encounters", new { popId = TempData["POPULATIONID"] })',//'/Encounters/GetAjaxPagedGridData/'+ '',
datatype: "jsonstring",
mtype: 'GET',
pager: '#pager',
height: '450',
...
然后你进入 colNames 和 colModels 以及所有与这个特定查询无关的东西。这是返回我的数据的方法。我只想说我做客户端分页的东西似乎有效。但除非我能真正看到数据,否则我无法验证?
我在这里做错了什么?
public string GetAjaxPagedGridData(int page, int rows, int popId) {
string userID = HttpContext.User.Identity.Name;
DataRepository dr = new DataRepository();
string encounter = dr.Get(popId, userID, "1", page, rows, "");
return encounter;
}
【问题讨论】:
标签: asp.net-mvc-4 jqgrid