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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 221k
  • Answers 221k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer 2023 Update Cloud vendors allow you to automatically provision SSL… May 13, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer Yes. I highly recommend Introduction to constructions, which is a… May 13, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer I think this is the best one: Converting between XML… May 13, 2026 at 12:09 am

Related Questions

I'm trying to learn how to use managed/unmanaged code interop, but I've hit a
The title pretty much sums it up, and I'm sure there's a perfectly valid
Question : What are tips and tools you can give us to help troubleshoot
I'm perhaps being a bit lazy asking this here, but I'm just getting started

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.