使用下一个和上一个按钮的分页在MVC 4中创建列表视图 [英] Creating List View in MVC 4 using pagination for next and previous buttons
本文介绍了使用下一个和上一个按钮的分页在MVC 4中创建列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想创建列表视图控件,我们可以在这里看到:
http://www.codeproject.com/search.aspx?q=* [ ^ ]
或在这个网站
http://www.espncricinfo.com/ci/content/story/news.html [ ^ ]
在MVC-4 Razor技术中。
请帮帮我。
谢谢,
Kapil
Hi All ,
I want to create List View control as we can see here :
http://www.codeproject.com/search.aspx?q=*[^]
or In this site
http://www.espncricinfo.com/ci/content/story/news.html[^]
In MVC- 4 Razor technology.
Please help me.
Thanks,
Kapil
推荐答案
@model IEnumerable< organizationmanagementsystem.models.employeemastermodel>
@ {
ViewBag。 Title =Index2;
布局=〜/ Views / Shared / _Layou t.cshtml;
ViewBag.maxPage =(ViewBag.recordsCount%OrganizationManagement.Common.Constants.rowsPerPage == 0)? (ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage):((ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage)+ 1);
}
@ * jquery.jqpagination.min
< script src =〜/ Scripts / jquery.jqpagination.min.js>< / script>
< script type =text / javascript>
@model IEnumerable<organizationmanagementsystem.models.employeemastermodel>
@{
ViewBag.Title = "Index2";
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.maxPage = (ViewBag.recordsCount % OrganizationManagement.Common.Constants.rowsPerPage == 0) ? (ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage) : ((ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage) + 1);
}
@*jquery.jqpagination.min
<script src="~/Scripts/jquery.jqpagination.min.js"></script>
<script type="text/javascript">
(document).ready(function(){
(document).ready(function () {
(''。pagination'')。jqPagination({
link_string:''〜/ Index2 /?page = {page_number}' ',
max_page:@ ViewBag.maxPage,
分页:功能(页面){
(''.pagination'').jqPagination({
link_string: ''~/Index2/?page={page_number}'',
max_page: @ViewBag.maxPage,
paged: function (page) {
这篇关于使用下一个和上一个按钮的分页在MVC 4中创建列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文