BootStrap Mvcpager Paging style (GET request, refreshing page) _c# Tutorial

Source: Internet
Author: User

How to use:

First add the Mvcpager.dll reference to the MVC project.

Front Code

Front desk:

@{Layout = null; @using Webdiyer.WebControls.Mvc @model pagedlist<string> <! DOCTYPE html>  

Background code

Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using SYSTEM.WEB.MVC;
Using WEBDIYER.WEBCONTROLS.MVC;
Namespace Mvcapplication6.controllers
{public
class Homecontroller:controller
{
////Get
: /home/public
actionresult Index (int pageindex=1, int pagesize=2)
{
list<string> list = new List <string> () {
"a",
"B",
"C",
"D"
};
return View (list. Topagedlist (PageIndex, pageSize));}}
 

Style change: class is pager or pagination

As shown in figure:

Style file:

. pagination {border-radius:4px; display:inline-block margin:20px 0; padding-left:0; pagination > li {display
: inline; Pagination > Li > A,. pagination > li > Span {background-color: #fff; border:1px solid #ddd; color: #337a
B7;
Float:left;
line-height:1.42857;
Margin-left: -1px;
PADDING:6PX 12px;
position:relative;
Text-decoration:none; }. Pagination > Li:first-child > A,. pagination > Li:first-child > span {border-bottom-left-radius:4px; bord
er-top-left-radius:4px;
margin-left:0; }. Pagination > Li:last-child > A,. pagination > Li:last-child > span {border-bottom-right-radius:4px; Borde
r-top-right-radius:4px; Pagination > li > A:hover,. pagination > li > Span:hover,. pagination > li > A:focus,. pagination ; Li > Span:focus {background-color: #eee; border-color: #ddd; color: #23527c; z-index:3;}. Pagination >. Active &G T A,. Pagination > Active > Span,. pagination >. Active; A:hover, pagination > Active > Span:hover,. pagination >. active > A:focus,. pagination >. active > SP An:focus {background-color: #337ab7; border-color: #337ab7; color: #fff; cursor:default; z-index:2; pagination > Disabled > span,. pagination > Disabled > Span:hover,. pagination >. Disabled > Span:focus,. Pagination &  gt; disabled > A,. pagination > Disabled > A:hover,. pagination >. Disabled > A:focus {background-color:
#fff;
Border-color: #ddd;
Color: #777;
cursor:not-allowed;  }/*.pagination-lg > Li > A,. pagination-lg > li > Span {font-size:18px; line-height:1.33333; padding:10px
16px; }. Pagination-lg > Li:first-child > A,. pagination-lg > Li:first-child > Span {border-bottom-left-radius:6px
;
border-top-left-radius:6px; 
}. Pagination-lg > Li:last-child > A,. pagination-lg > Li:last-child > span {border-bottom-right-radius:6px;
border-top-right-radius:6px; }. pagination-SM > li > A,. pagination-sm > li > Span {font-size:12px; line-height:1.5 padding:5px 10px; pagination- SM > Li:first-child > A,. pagination-sm > Li:first-child > Span {border-bottom-left-radius:3px; border-top-l
eft-radius:3px; 
}. pagination-sm > Li:last-child > A,. pagination-sm > Li:last-child > span {border-bottom-right-radius:3px;
border-top-right-radius:3px; }*/. Pager {list-style:outside None none; margin:20px 0; padding-left:0; text-align:center; Pager Li {display:in
Line Pager li > A,. Pager li > Span {background-color: #fff; border:1px solid #ddd; border-radius:15px
Line-block;
padding:5px 14px;
Text-decoration:none; Pager li > a:hover,. Pager li > A:focus {background-color: #eee; text-decoration:none;. Pager. Next > A. Pager. Next > Span {float:right}. Pager. previous > A,. pager. Previous > span {float:left; pager. Disab Led > A,. pager. Disabled > A:hover, pager. Disabled > A:focus,. Pager. Disabled > Span {background-color: #fff; color: #777; cursor:not-allowed; Pager > Active > A,. pager >. active > Span,. pager >. active > A:hover,. Pager >. active > S Pan:hover, pager > Active > A:focus,. Pager >. active > Span:focus {background-color: #eee; cursor:default
;
Z-index:2; }

The above is a small set to introduce the Bootstrap Mvcpager page style (GET request, refresh the page), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.