Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 页面列表MVC 3-未显示页码 `在这里输入代码` 视图第1页 代码 名称 Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly);%%>_Asp.net Mvc_Asp.net Mvc 3_Pagedlist - Fatal编程技术网

Asp.net mvc 页面列表MVC 3-未显示页码 `在这里输入代码` 视图第1页 代码 名称 Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly);%%>

Asp.net mvc 页面列表MVC 3-未显示页码 `在这里输入代码` 视图第1页 代码 名称 Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly);%%>,asp.net-mvc,asp.net-mvc-3,pagedlist,Asp.net Mvc,Asp.net Mvc 3,Pagedlist,然后从控制器那里我得到了列表和 ViewBag.OnePageDivisions=所有列表 我可以获取列表并显示它 问题是下面的页码没有显示 CSS“PagedList.CSS”是从包中提取的。谢谢你的帮助 我正在使用MVC 3、PagedList 1.15.0.0和PagedList.MVC 3.18.0.0 <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <%@ Imp

然后从控制器那里我得到了列表和

ViewBag.OnePageDivisions=所有列表

我可以获取列表并显示它

问题是下面的页码没有显示

CSS“PagedList.CSS”是从包中提取的。谢谢你的帮助

我正在使用MVC 3、PagedList 1.15.0.0和PagedList.MVC 3.18.0.0

 <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="PagedList.Mvc" %>
<%@ Import Namespace="PagedList" %>

<!DOCTYPE html>`enter code here`

<html>
<head runat="server">
    <title>ViewPage1</title>
    <link href="../../Public/css/PagedList.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div>
        <table class="tableEmptyStyle">
        <tr>

        </tr>
    </table>
    <table>
        <tr>          
            <th>
                Code
            </th>
            <th>
                Name
            </th>            
        </tr>
        <%            
            foreach (var item in ViewBag.OnePageDivisions)
           { %>
        <tr>
           <td>
                <%: item.Code %>
            </td>
            <td>
                <%: item.Name %>
            </td>
         </tr>
        <% Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly); %>
        <% } %>        
    </table>
Url.Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly);%%>

Url.Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly)%%>
更改

 <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="PagedList.Mvc" %>
<%@ Import Namespace="PagedList" %>

<!DOCTYPE html>`enter code here`

<html>
<head runat="server">
    <title>ViewPage1</title>
    <link href="../../Public/css/PagedList.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div>
        <table class="tableEmptyStyle">
        <tr>

        </tr>
    </table>
    <table>
        <tr>          
            <th>
                Code
            </th>
            <th>
                Name
            </th>            
        </tr>
        <%            
            foreach (var item in ViewBag.OnePageDivisions)
           { %>
        <tr>
           <td>
                <%: item.Code %>
            </td>
            <td>
                <%: item.Name %>
            </td>
         </tr>
        <% Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly); %>
        <% } %>        
    </table>
Url.Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly);%%>

Url.Action(“Index”,new{page=page}),PagedListRenderOptions.PageNumberOnly)%%>
<%: Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly) %>