【问题标题】:PagedList.MVC with EnableUnobtrusiveAjaxReplacing and other render optionPagedList.MVC 与 EnableUnobtrusiveAjaxReplacing 和其他渲染选项
【发布时间】:2014-07-16 17:45:13
【问题描述】:

我有这样的寻呼机:

@Html.PagedListPager(Model.komentarzeListModeracja, page => 
    Url.Action("ModeracjaKomentarze", new { 
        DotyczyID = Model.DotyczyID, page 
        }), 
    PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { 
        HttpMethod = "Get", UpdateTargetId = "ModeracjaUpdate1" 
        }))

你能告诉我如何添加其他渲染选项吗?是否可以 ?。

【问题讨论】:

    标签: model-view-controller pagedlist


    【解决方案1】:

    该类中已经包含了多个版本\风格(启用智能感知:Classic 到 OnlyShowFivePagesAtATime、Minimal 和 Bootstrap 等)。

    PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(PagedListRenderOptions.TwitterBootstrapPagerAligned, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "divpagedlist" }))
    
    PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(PagedListRenderOptions.ClassicPlusFirstAndLast, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "divpagedlist" }))
    

    类的简单的逗号分隔属性。

    目前对 PagedListRenderOptions (Class) 属性的一个很好的参考: http://www.nudoq.org/#!/Packages/PagedList.Mvc/PagedList.Mvc/PagedListRenderOptions (请注意这个网站是测试版,不能确定链接的有效期)

    【讨论】:

      【解决方案2】:

      另一种方式...

      @Html.PagedListPager(Model, page => Url.Action("FileIndex",
      new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }),
      PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new PagedListRenderOptions()
      {
          DisplayLinkToLastPage = PagedListDisplayMode.IfNeeded,
          DisplayLinkToFirstPage = PagedListDisplayMode.IfNeeded,
          Display = PagedListDisplayMode.IfNeeded,
          LiElementClasses = new List<string> { "myClass", "yourClass" },
          MaximumPageNumbersToDisplay = 10
      }, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "fileListTable" }))
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-08
        • 1970-01-01
        • 2012-01-06
        • 2020-07-02
        • 2016-03-31
        • 2019-08-31
        相关资源
        最近更新 更多