转载:http://www.cnblogs.com/libingql/archive/2012/04/22/2464994.html
cshtml
@{ Layout = null;}Ext.grid.Panel动态加载分页数据
controller
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using Northwind.Domain.Entities;using Northwind.Data;using Northwind.Service;namespace Northwind.Web.Controllers{ public class ProvinceController : Controller { private IProvinceService provinceService; public ProvinceController(IProvinceService provinceService) { this.provinceService = provinceService; } public ActionResult Grid() { return View(); } ////// 省份分页数据 /// /// 当前页 /// 分页大小 ///public JsonResult List(int page, int limit) { int totalRecords; return Json(new { root = provinceService.GetPaged(page, limit, out totalRecords), totalProperty = totalRecords }, JsonRequestBehavior.AllowGet); } }}
效果图: