Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 358299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:17:11+00:00 2026-05-12T12:17:11+00:00

This started as a question, but turned into a solution as I did some

  • 0

This started as a question, but turned into a solution as I did some experimenting! So I thought I would share this with you all. My question WAS:

How to use MvcContrib.Pagination without using MvcContrib.Grid View?

My answer is below…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:17:11+00:00Added an answer on May 12, 2026 at 12:17 pm

    I am building a Help Desk Ticketing System (I am kind of a C# newbie – got many pointers from NerdDinner) and I wish to use some sort of paging library to help with the view. I found MvcContrib.Pagination and I got it to work for a view. My view does NOT use MvcContrib.Grid because it is custom.

    Scaled down version of my view List.aspx :

    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyProject.Areas.HelpDesk.Models.hd_Ticket>>" %>
    <%@ Import Namespace="MyProject.Areas.HelpDesk.Controllers" %>
    <%@ Import Namespace="MvcContrib.Pagination" %>
    
    <h2>Help Desk Tickets (showing <%= Model.Count() %> of <%= ViewData["totalItems"] %>)</h2>     
    
    <% foreach (var item in Model) { %>
        <h3><%= Html.Encode(item.Subject)%></h3>
    <% } %>
    
    <p><%= Html.Pager((IPagination)Model)%></p>
    

    My controller (part) TicketController.cs :

    TicketRepository ticketRepository = new TicketRepository();
    
    public ActionResult List(int? page, int? pageSize)
    {
        IPagination<hd_Ticket> tickets = null;
    
        int dPageSize = 50;
        int totalItems;
    
        tickets = ticketRepository.GetTickets().ToList().AsPagination(page ?? 1, pageSize ?? dPageSize);
        ViewData["totalItems"] = tickets.TotalItems;
    
        return View("List", tickets);
    }
    

    I am using the repository pattern which is returning the results as IQueryable. Here is part of the TicketRepository.cs file:

    public class TicketRepository
    {
        private HelpDeskDataContext db = new HelpDeskDataContext();
    
        public IQueryable<hd_Ticket> FindAllTickets()
        {
            return from ticket in db.hd_Tickets
                   orderby ticket.CreatedDate descending
                   select ticket;
        }
    }
    

    All this may be trivial to some, but if someone like me is trying to learn C# and ASP.NET MVC and paging, then this may be useful. I recommend newbies to do the NerdDinner tutorial found at:

    http://nerddinnerbook.s3.amazonaws.com/Intro.htm

    🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this isn't a straightforward question but I would really appreciate some feedback
I originally started this question in another thread, but that thread was sorta, kinda
This post started as a question on ServerFault ( https://serverfault.com/questions/131156/user-receiving-partial-downloads ) but I determined
I read all the answers that popped up when I started posting this question
This question started out here . But changed significantly as I learned more about
Sorry if this is an elementary question but I've just started to consider whether
I did check those posts about Infinite gallery before posting this question but it
This might be a really easy question but I would like to grab the
Just started with Node.JS, maybe this is more a javascript question but, its a
Note This originally started as a question about 404 errors, but now it's a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.