我是这样使用它的:
<%= Html.Pager((IPagination)Model) %>
是否有简单的方法来更改呈现的 url。我查看了更多文档,但找不到太多。
最佳答案
你到底想改变什么?
这是我更改 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
}
关于asp.net-mvc - MVC 贡献寻呼机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4452031/