MVC contrib 寻呼机

2024-03-26

我这样使用它:

<%= Html.Pager((IPagination)Model) %>

有没有简单的方法来更改呈现的网址。我查找了更多文档,但找不到太多。


你到底想改变什么?

这是我更改 URL 的方法:

 Html.Pager(Model.AssetsPagedList)
        .First("First")
        .Last("Last")
        .Next("Next")
        .Previous("Previous")
          .Link(currentPage => Url.Action("Browse", new {  
            page = currentPage,
            searchTerm = Model.SearchModel.SearchTerm,
            excludedWords = Model.SearchModel.ExcludedWords,
            minPrice = Model.SearchModel.MinPrice,
            maxPrice = Model.SearchModel.MaxPrice,
            locationId = Model.SearchModel.LocationId,  
            catalogId = Model.SearchModel.CatalogId
        })) 

您还可以创建一个类似这样的助手:

public static Pager Pager(this HtmlHelper helper, IPagination model, FormCollection formCollection)
    {
      // here you can use MvcContrib.UI.Pager.PaginationExtensions.Pager static methods
      // or create MvcContrib.Pagination.Pager class directly
    }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

MVC contrib 寻呼机 的相关文章

随机推荐