Solved

using a partial view with a different model

Posted on 2014-11-04
3
122 Views
Last Modified: 2015-01-07
I have a page that uses a @model IEnumerable<T>. I want to include a partial view on the page that has its own model. How can I add this?

I keep getting an error The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[]', but this dictionary requires a model item of type ''.
0
Comment
Question by:NickMalloy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40423930
In the partial view, did you add a @model attribute?
0
 

Author Comment

by:NickMalloy
ID: 40424977
Yes I did
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40425035
Can you show me the main view, where you call the partial view, and the partial view?
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MYSQL responding very slow 3 50
asp.net mvc 2 35
Need help converting bitmap to image in VB.Net 8 45
aspx ascx, c# 7 17
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question