<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼

        來源:懂視網 責編:小采 時間:2020-11-27 22:35:26
        文檔

        ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼

        ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼:ASP.NET MVC中進行分頁的方式有多種,在NuGet上有提供使用PagedList、PagedList.Mvc進行分頁。 在安裝引用PagedList.Mvc的同時會安裝引用PagedList。 代碼如下: @Html.PagedListPager((PagedList.IPagedList<Sam
        推薦度:
        導讀ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼:ASP.NET MVC中進行分頁的方式有多種,在NuGet上有提供使用PagedList、PagedList.Mvc進行分頁。 在安裝引用PagedList.Mvc的同時會安裝引用PagedList。 代碼如下: @Html.PagedListPager((PagedList.IPagedList<Sam

        ASP.NET MVC中進行分頁的方式有多種,在NuGet上有提供使用PagedList、PagedList.Mvc進行分頁。

        在安裝引用PagedList.Mvc的同時會安裝引用PagedList。

        代碼如下:
         @Html.PagedListPager((PagedList.IPagedList<SampleInfo>)ViewBag.Models, page => Url.Action("Index", new { page, keyword = Request["keyword"], datemin = Request["datemin"], datemax = Request["datemax"] }))

        搜索觸發事件:

         <input type="text" id="datemin" class="input-text Wdate" style="width:60px;" value="@Request["datemin"]">
         <input type="text" id="datemax" class="input-text Wdate" style="width:60px;" value="@Request["datemax"]">
         <input type="text" class="input-text" style="width:250px" placeholder="輸入關鍵詞" id="keyword" name="" value="@Request["keyword"]">
         <button type="submit" class="btn btn-success" id="" name="" onclick="search()"><i class="icon-search"></i> 搜索</button>
         <script>
         function search() {
         var url = "?type=1";
         if ($("#keyword").val() != "") {
         url += "&keyword=" + $("#keyword").val();
         }
         if ($("#datemin").val() != "") {
         url += "&datemin=" + $("#datemin").val();
         }
         if ($("#datemax").val() != "") {
         url += "&datemax=" + $("#datemax").val();
         }
         window.location.href = "/Admin/SampleInfo/Index"+url;
         }
         </script>
        
        

        后臺方法:

        IQueryable<SampleInfo> models = db.SampleInfoBLL.GetAllEntities().Where(d => d.IsDel == false);
        if (!String.IsNullOrEmpty(Request["keyword"]))
        {
        string keyword = Request["keyword"];
        models = models.Where(d => d.Site_Chinese.Contains(keyword));
        }
        if (!String.IsNullOrEmpty(Request["datemin"]))
        {
        int datemin = Convert.ToInt32(Request["datemin"]);
        models = models.Where(d => Convert.ToDouble(d.Lon_Degree) >= datemin);
        }
        if (!String.IsNullOrEmpty(Request["datemax"]))
        {
        int datemax = Convert.ToInt32(Request["datemax"]);
        models = models.Where(d => Convert.ToDouble(d.Lat_Degree) <= datemax);
        }
        int page = 1;
        if (Request["page"] != null)
        {
        page = Convert.ToInt32(Request["page"]);
        }
        ViewBag.ModelsCount = models.Count();
        ViewBag.Models = models.OrderBy(d => d.SampleInfoID).ToPagedList(page, 10);
        
        

        分頁控件樣式:

        .pagination {
         display: inline-block;
         padding-left: 0;
         margin: 20px 0;
         border-radius: 4px;
        }
        
        .pagination > li {
         display: inline;
        }
        
        .pagination > li > a,
        .pagination > li > span {
         position: relative;
         float: left;
         padding: 6px 12px;
         margin-left: -1px;
         line-height: 1.428571429;
         text-decoration: none;
         background-color: #ffffff;
         border: 1px solid #dddddd;
        }
        
        .pagination > li:first-child > a,
        .pagination > li:first-child > span {
         margin-left: 0;
         border-bottom-left-radius: 4px;
         border-top-left-radius: 4px;
        }
        
        .pagination > li:last-child > a,
        .pagination > li:last-child > span {
         border-top-right-radius: 4px;
         border-bottom-right-radius: 4px;
        }
        
        .pagination > li > a:hover,
        .pagination > li > span:hover,
        .pagination > li > a:focus,
        .pagination > li > span:focus {
         background-color: #eeeeee;
        }
        
        .pagination > .active > a,
        .pagination > .active > span,
        .pagination > .active > a:hover,
        .pagination > .active > span:hover,
        .pagination > .active > a:focus,
        .pagination > .active > span:focus {
         z-index: 2;
         color: #ffffff;
         cursor: default;
         background-color: #428bca;
         border-color: #428bca;
        }
        
        .pagination > .disabled > span,
        .pagination > .disabled > a,
        .pagination > .disabled > a:hover,
        .pagination > .disabled > a:focus {
         color: #999999;
         cursor: not-allowed;
         background-color: #ffffff;
         border-color: #dddddd;
        }
        
        .pagination-lg > li > a,
        .pagination-lg > li > span {
         padding: 10px 16px;
         font-size: 18px;
        }
        
        .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-top-right-radius: 6px;
         border-bottom-right-radius: 6px;
        }
        
        .pagination-sm > li > a,
        .pagination-sm > li > span {
         padding: 5px 10px;
         font-size: 12px;
        }
        
        .pagination-sm > li:first-child > a,
        .pagination-sm > li:first-child > span {
         border-bottom-left-radius: 3px;
         border-top-left-radius: 3px;
        }
        
        .pagination-sm > li:last-child > a,
        .pagination-sm > li:last-child > span {
         border-top-right-radius: 3px;
         border-bottom-right-radius: 3px;
        }
        
        .pager {
         padding-left: 0;
         margin: 20px 0;
         text-align: center;
         list-style: none;
        }
        
        .pager:before,
        .pager:after {
         display: table;
         content: " ";
        }
        
        .pager:after {
         clear: both;
        }
        
        .pager:before,
        .pager:after {
         display: table;
         content: " ";
        }
        
        .pager:after {
         clear: both;
        }
        
        .pager li {
         display: inline;
        }
        
        .pager li > a,
        .pager li > span {
         display: inline-block;
         padding: 5px 14px;
         background-color: #ffffff;
         border: 1px solid #dddddd;
         border-radius: 15px;
        }
        
        .pager li > a:hover,
        .pager li > a:focus {
         text-decoration: none;
         background-color: #eeeeee;
        }
        
        .pager .next > a,
        .pager .next > span {
         float: right;
        }
        
        .pager .previous > a,
        .pager .previous > span {
         float: left;
        }
        
        .pager .disabled > a,
        .pager .disabled > a:hover,
        .pager .disabled > a:focus,
        .pager .disabled > span {
         color: #999999;
         cursor: not-allowed;
         background-color: #ffffff;
        }
        .pagination-container {
         text-align: center;
        }
        
        

        分頁樣式效果:

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼

        ASP.NET MVC 4使用PagedList.Mvc分頁的實現代碼:ASP.NET MVC中進行分頁的方式有多種,在NuGet上有提供使用PagedList、PagedList.Mvc進行分頁。 在安裝引用PagedList.Mvc的同時會安裝引用PagedList。 代碼如下: @Html.PagedListPager((PagedList.IPagedList<Sam
        推薦度:
        標簽: 分頁 分頁的 mvc
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 中文字幕亚洲精品| 在线观看免费宅男视频| 中文字幕亚洲综合久久菠萝蜜| 日韩高清免费在线观看| 亚洲一区二区三区四区视频| 6080午夜一级毛片免费看6080夜福利| 啦啦啦高清视频在线观看免费| 亚洲国产综合自在线另类| 麻豆高清免费国产一区| 亚洲免费在线观看视频| 中字幕视频在线永久在线观看免费| 亚洲第一成年人网站| 无码免费午夜福利片在线| 最新亚洲卡一卡二卡三新区| 免费视频中文字幕| 免费夜色污私人影院网站| 在线观看亚洲成人| 最近中文字幕2019高清免费| 亚洲精品国产高清不卡在线| 夜夜爽妓女8888视频免费观看| 国产电影午夜成年免费视频 | 中文字幕精品亚洲无线码一区| 永久免费无码网站在线观看个| 亚洲人精品午夜射精日韩| 精品无码专区亚洲| 1000部羞羞禁止免费观看视频 | 免费乱码中文字幕网站| 成人免费av一区二区三区| 亚洲人成电影福利在线播放| 无码少妇一区二区浪潮免费| 免费的黄色的网站| 国产av无码专区亚洲av桃花庵| 美女黄频视频大全免费的| 亚洲春色在线视频| 国产精品免费观看久久| jizz免费观看| 久久精品亚洲AV久久久无码 | 亚洲精品免费视频| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 国产午夜鲁丝片AV无码免费| 中文字幕日本人妻久久久免费|