国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

PagedList分頁(yè)

2019-11-14 16:44:40
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

@using PagedList.Mvc;
@model PagedList.ipagedList<MvcapplicationBootStramp.Models.Person>

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    
    <link href="~/Content/PagedList.CSS" rel="stylesheet" />//記得引用這個(gè)css文件
</head>
<body>
    <table>
        <tr>
            <th>ID
            </th>
            <th>姓名
            </th>
            <th>地址
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Id)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Address)
                </td>
            </tr>
        }
    </table>
    
       @Html.PagedListPager(Model, page => Url.Action("Index", new { page }), new PagedListRenderOptions() { LinkToFirstPageFormat = "首頁(yè)", LinkToNextPageFormat = "下一頁(yè)", LinkToPReviousPageFormat = "上一頁(yè)", LinkToLastPageFormat = "末頁(yè)",DisplayItemSliceAndTotal=true, ItemSliceAndTotalFormat="共有{2}頁(yè)", MaximumPageNumbersToDisplay=6})  //{2}占位符
   
</body>
</html>

 

  // GET: /Person/
        PersonDAL person = new PersonDAL();
        public ActionResult Index(int page = 1)
        {
           
            return View(person.GetPersons().ToPagedList(page, 5));
           // return View();
        }

效果截圖


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 开封县| 南阳市| 文安县| 锡林郭勒盟| 富源县| 和政县| 米易县| 顺义区| 阆中市| 宕昌县| 金山区| 高密市| 永城市| 易门县| 赞皇县| 玛纳斯县| 奇台县| 张家口市| 榆中县| 醴陵市| 泰来县| 清苑县| 高要市| 综艺| 哈巴河县| 多伦县| 闽侯县| 洛浦县| 宁陵县| 金阳县| 河津市| 全椒县| 潼关县| 同仁县| 和静县| 宾阳县| 宜兰市| 三都| 徐汇区| 万州区| 且末县|