Solved

using a partial view with a different model

Posted on 2014-11-04
3
114 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now