回答
你到底想要改變什麼?
我這是怎麼改變的網址:
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
}
我試過<%= Html.Pager((IPagination)Model).Link(currentPage => Url.Action(「Index」,new {page = currentPage}))%>,但索引位是swalloed。如果我使用「Bla」而不是「Index」,則會生成URL。爲什麼是這樣?謝謝。 – cs0815 2010-12-16 11:01:20
不知道。如果你想弄明白,你可以下載源代碼,編譯它並使用調試器。代碼並不複雜。 – rboarman 2010-12-16 16:55:30
對我來說這不起作用,因爲現在頁面對於下一頁(頁面= 1)和上一頁(頁面= 1)是相同的。你需要在鏈接代表中區分它們,但你不能。我錯過了什麼? – Rookian 2012-09-23 10:32:36
你可以傳入任何可澆注到IPagination的東西。例如,看到這樣的問題/答案:MvcContrib.UI.Grid pagination problem
您也可以使用jQuery修改生成時間後的尋呼機。看到這個帖子的例子:http://thekindofme.wordpress.com/2009/01/12/ajax-enabling-mvccontrib-grid-pagination-with-jquery/
這真的取決於你想改變什麼事情。
在下面的示例,我改變了分頁鏈接使用AJAX
$("#addressListPlaceholder .paginationRight a").click(function (event) {
event.preventDefault();
$.ajax({
type: "get",
dataType: "html",
url: this.href,
data: {},
success: function (response) {
$("#addressListPlaceholder").html('').html(response);
}
});
});
- 1. MVC的contrib網 - 尋呼機
- 2. ASP.Net中的尋呼機設計MVC
- 3. ASP.NET MVC 3.0更換MvcGrid尋呼機
- 4. ASP.Net MVC Webgrid自定義尋呼機
- 5. 在git中關閉尋呼機的尋呼機只有
- 6. 查看尋呼機 - 獲得每頁的尋呼機號碼
- 7. 尋呼在asp.net mvc的
- 8. 尋呼與asp.net的MVC C#
- 9. D7尋呼機查詢 - 尋呼機頁面太多
- 10. Drupal的 - 在尋呼機
- 11. 尋呼機的頁數
- 12. 的jqGrid:從尋呼機
- 13. 尋呼機在jqGrid的
- 14. 在MVC + Jquery中尋呼
- 15. 在asp.net-mvc-2中尋呼
- 16. 在MVC的contrib
- 17. ASPxGridView尋呼機消失
- 18. MvcContrib尋呼機樣式
- 19. Mercurial尋呼機擴展
- 20. jQuery週期尋呼機
- 21. RecyclerView與查看尋呼機
- 22. 與視圖尋呼機
- 23. MVCContrib尋呼機圖像
- 24. 自尋呼機XPages中
- 25. Php尋呼機問題
- 26. 尋呼機風格在asp.net
- 27. 語法高亮尋呼機
- 28. jqgrid:尋呼機對齊
- 29. 尋呼機的jqGrid在我的MVC應用程序不可見
- 30. 查看尋呼機的圓形指示器到自定義查看尋呼機
那你想幹什麼? – Lorenzo 2010-12-15 16:26:14
我的問題是,我在控制器的索引視圖中有一個網格,並且該操作位被吞下。它適用於其他視圖,但不適用於索引視圖。所以我認爲我可以強制創建動作位以生成正確的URL。 – cs0815 2010-12-16 10:54:46
我嘗試了<%= Html.Pager((IPagination)Model) .Link(currentPage => Url.Action(「Index」,new {page = currentPage })) %但是索引位是swalloed。如果我使用「Bla」而不是「Index」,則會生成URL。爲什麼是這樣?謝謝。 – cs0815 2010-12-16 11:01:00