Ajax+ashx+json三层架构无刷新分页、删除、修改、查看

展开阅读全文

MVC3.0 ajax无刷新分页

08-19

controllerrn[code=csharp] rn model.LogList = dtos.Select(obj => new BuyLogModel()rn rn BuyDate = obj.BuyDate,rn BuyID = obj.BuyID,rn BuyNum = obj.BuyNum,rn ChildItemID = obj.ChildItemID,rn Color = obj.Color,rn Price = obj.Price,rn SpecTitle = obj.SpecTitle,rn SpecValue = obj.SpecValue,rn UserID = obj.UserID,rn UserName = string.Emptyrn ).OrderByDescending(t=>t.BuyDate).ToPagedList(index??1,15);rnrnif (Request.IsAjaxRequest())rn return PartialView("UCSellLogList",model.LogList);rnrn[/code]rnrnmodelrn[code=csharp]rnpublic class DetailModelrn rn public Guid ID get; set; rn public string Img get; set; rn public string Title get; set; rn public string Summary get; set; rn public string Desc get; set; rn public int RestDay get; set; rn public decimal TotalPrice get; set; rn public int Percentage get; set; rn public string ShopUrl get; set; rn public int? AppearanceStore get; set; rn public int? FunctionStore get; set; rn public int? PriceStore get; set; rn public int? TotalStore get; set; rn public string ReviewDesc get; set; rn public DateTime? EndDate get; set; rn public List UserList get; set; rn public PagedList LogList get; set; rn public PagedList ReviewList get; set; rnrn public List> SpecsArray get; set; rn public List Items get; set; rn rnrnpublic class BuyLogModelrn rn public Guid? UserID get; set; rnrn public string UserName get; set; rn rn public Guid? ChildItemID get; set; rnrn public int? BuyNum get; set; rnrn public decimal? Price get; set; rnrn public Guid BuyID get; set; rnrn public DateTime? BuyDate get; set; rnrn public string SpecTitle get; set; rnrn public string SpecValue get; set; rnrn public string Color get; set; rnrn rnrn[/code]rnrnPartialViewrn[code=html]rn@model PagedListrnrn rn rn 购买者rn 数量rn 价格rn 购买日期rn 规格/颜色rn rnrn @foreach (var item in Model)rn rn rn @item.UserNamern @item.BuyNumrn @item.Pricern rn @if (item.BuyDate.HasValue)rn rn @item.BuyDate.Value.ToString("yyyy-MM-dd")rn rn rn rn @item.SpecValue/ @if (item.Color != null)rn @item.Colorrn elsern 无rn rn rn rn[/code]rnrnviewrn[code=html]rn rn @Html.RenderPartial("UCSellLogList", Model.LogList);rn @Ajax.Pager(Model.LogList,rn new PagerOptions PageIndexParameterName = "index", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.DropDownList,ShowGoButton = false,rn new MvcAjaxOptionsUpdateTargetId="dlBuyLogs",EnablePartialLoading = true,null)rn rn[/code]rnrnrn以上是代码,问题是 分页正常 数据正常 但还是会刷新,找高手帮忙看下哪里有问题? 论坛

没有更多推荐了,返回首页