Solved

using a partial view with a different model

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

20 Experts available now in Live!

Get 1:1 Help Now