asp.net mvc 3 - MVC pagedlist.mvc and aspx view -


i have got page im using nuget package pagedlist.mvc 3.0.18 (the latest version mvc3). problem when i'm listing pages makes pages list of like

  • previous
  • 1
  • 2
  • 3
  • 4
  • next
  • instead of < 1,2,3,4,5,6,7.. >

    my view looks like

    <%@ page title="" language="c#" masterpagefile="~/views/shared/site.master" inherits="system.web.mvc.viewpage<ipagedlist<news>>" %> <%@ import namespace="pagedlist" %> <%@ import namespace="pagedlist.mvc" %>  <asp:content id="content2" contentplaceholderid="maincontent" runat="server">   <table>  <tr>  <td> <% foreach (var v in model)    {%>      <%: v.content %><br />     <%: v.datecreated %><br />     <%: v.email %><br />  <%} %>  <h2>news</h2>  <%: html.pagedlistpager(model, page => url.action("news", new { page }), pagedlistrenderoptions.minimal)%> 

    code behind looks like

    public actionresult news(int? page)         {             list<news> products = homebll.getnewslist(); //returns iqueryable<product> representing unknown number of products. thousand maybe?              var pagenumber =  page ?? 1; // if no page specified in querystring, default first page (1)             var onepageofproducts = products.topagedlist(pagenumber, 25); // contain 25 products max because of pagesize              viewbag.onepageofproducts = onepageofproducts;              return view(onepageofproducts);         } 

    any suggestions on wrong? standard css included well.

    you should include pagedlist.css in view (it located in content folder).


    Comments

    Popular posts from this blog

    html5 - What is breaking my page when printing? -

    c# - must be a non-abstract type with a public parameterless constructor in redis -

    ajax - PHP/JSON Login script (Twitter style) not setting sessions -