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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:22:30+00:00 2026-06-12T17:22:30+00:00

Can I not render a strongly typed partial in a strongly typed view? I

  • 0

Can I not render a strongly typed partial in a strongly typed view?

I am getting the following error when I try to:

The model item passed into the dictionary is of type
‘System.Data.Linq.Table1[UI.Models.vwProject]', but this dictionary
requires a model item of type
'System.Collections.Generic.IEnumerable
1[UI.Models.ProjectStatus]’.

I populate both the views using ViewData.Model

public ActionResult Index()
{
    ViewData.Model = project.vw_Projects;
    return View();
}

public ActionResult ProjectStatus()
{
    ViewData.Model = project.ProjectStatus;
    return View();
}

Here is my View:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<UI.Models.vwProject>>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div>
    <table>
    <tr>
        <th>
            Project
        </th>
        <th>
            Hours
        </th>
    </tr>
    <tr>
        <td>
            <%= Html.Encode(item.ProjectCode) %>
        </td>
        <td>
            <%= Html.Encode(item.ProjectHours) %>
        </td>
    </tr>

<div>
 <%  Html.RenderPartial("ProjectStatus"); %>
</div>

</asp:Content>

Here is my partial:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<UI.Models.ProjectStatus>>" %>

    <table>
        <tr>
            <th>
                Code
            </th>
            <th>
                Status
            </th>
        </tr>

    <% foreach (var item in Model) { %>

        <tr>
            <td>
                <%= Html.Encode(item.ProjectCode) %>
            </td>
            <td>
                <%= Html.Encode(item.ProjectStatus) %>
            </td>
        </tr>

    <% } %>

    </table>

I am a little confused with how to display strongly typed/dynamic partials in strongly type or dynamic views. Can someone help me resolve this issue?

  • 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-06-12T17:22:32+00:00Added an answer on June 12, 2026 at 5:22 pm

    If you render a partial it won’t hit you controller action just renders out the view with using the partent’s view model by default.

    If you want call your controller action ProjectStatus then what you need is the RenderAction method:

    <%  Html.RenderAction("ProjectStatus"); %>
    

    A good article about When to use RenderAction vs RenderPartial with ASP.NET MVC

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

Sidebar

Related Questions

I have a strongly typed Person view, that I want to render a partial
I am using a strongly typed model for my view. I have a disabled
I have a strongly-typed view with a @model declaration: @model MyViewModel When using extension
Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
I can not get to make this comparison in this simple code error ..
I can not locate the correct method to make the first item in a
I have a problem I can not resolve on a form Here's my view:
My question is similar to this following post Render a view of another controller
I can not get normals to render properly with a VBO. Below is the
I can't get my page to render a partial. When I pull run it

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.