Solved

using a partial view with a different model

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

766 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