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 257807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:07:41+00:00 2026-05-11T22:07:41+00:00

I have a view that takes a PaginatedList (like in Nerd Dinner sample). The

  • 0

I have a view that takes a PaginatedList (like in Nerd Dinner sample). The page works as intended. Now I have added a partial view that takes the same PaginatedList and I call RnederPartial inside the first view. ASP.NET throws a exception that I can’t seem to resolve.

PaginatedList Code:

public class PaginatedList<T> : List<T>
{
    public int PageIndex { get; private set; }
    public int PageSize { get; private set; }
    public int TotalCount { get; private set; }
    public int TotalPages { get; private set; }

    public PaginatedList(IQueryable<T> source, int pageIndex, int pageSize)
    {
        PageIndex = pageIndex;
        PageSize = pageSize;
        TotalCount = source.Count();
        TotalPages = (int)Math.Ceiling(TotalCount / (double)PageSize);
        this.AddRange(source.Skip(PageIndex * PageSize).Take(PageSize));
    }

    public bool HasPreviousPage
    {
        get
        {
            return (PageIndex > 0);
        }
    }

    public bool HasNextPage
    {
        get
        {
            return (PageIndex + 1 < TotalPages);
        }
    }
}

Controller:

[Authorize]
public ActionResult Index(int? page)
{
    const int pageSize = 10;

    var workstations = itilRepository.FindAllWorkstations();

    var paginatedWorkstations = new PaginatedList<Workstation>(workstations, page ?? 0, pageSize);

    return View("Index", paginatedWorkstations);
}

Top of Index View:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ITILDatabase.Helpers.PaginatedList<ITILDatabase.Models.Workstation>>" %>

I call the partial view in the Index view as follows:

<% Html.RenderPartial("Workstations", Model); %>

Top of Workstations Partial View:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewPage<ITILDatabase.Helpers.PaginatedList<ITILDatabase.Models.Workstation>>" %>

The error I receive is:

c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d2889d23\c6192b3e\App_Web_workstations.ascx.a8d08dba.tgrd74s0.0.cs(156): error CS0030: Cannot convert type ‘ASP.views_home_workstations_ascx’ to ‘System.Web.Mvc.ViewUserControl’

If anyone knows why I am getting this error I would greatly appreciate it.

Thank You!

  • 1 1 Answer
  • 2 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-11T22:07:41+00:00Added an answer on May 11, 2026 at 10:07 pm

    Your Workstations Partial View’s top should look like:

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ITILDatabase.Helpers.PaginatedList<ITILDatabase.Models.Workstation>>" %>
    

    Change ViewPage to ViewUserControl

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

Sidebar

Related Questions

I have an index view that takes the page parameter like so: /News?page=2 But
I have a strongly-typed Partial View that takes a ProductImage and when it is
I have a view that takes data from my site and then makes it
I have a single-view application that takes in a username and a password and
I have a partial view that I want to basically take care of itself
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl
I have a view that takes a Ruby Date, performs some formatting on it
I have a main view controller that takes care of the drawing for my
OK so I have a strongly-typed Customer Details view that takes a Customer object
So I have a view model that takes an instance of IAdapter right? And

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.