Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/' Application.

The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[AppProgram.Areas.SSRelated.Models.WorkType]', but this dictionary requires a model item of type 'AppProgram.Models.LoginViewModel'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[AppProgram.Areas.SSRelated.Models.WorkType]', but this dictionary requires a model item of type 'AppProgram.Models.LoginViewModel'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Posted
Updated 7-Dec-14 0:34am
v3
Comments
Nelek 7-Dec-14 6:34am    
Don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.

Please use the "improve question" and add relevant information or a piece of code envolved. There are thousands of ways to screw things up, how are we supposed to know which one did you choose?

You really need to read these links:
What have you tried?[^]
How to ask a question?[^]
Maria Lopez 7-Dec-14 7:38am    
well said...

1 solution

Hi,

Exception message is saying all you want to know. You are using wrong type in wrong place.

You are passing:
C#
System.Collections.Generic.List<AppProgram.Areas.SSRelated.Models.WorkType>

where excepted is:
C#
AppProgram.Models.LoginViewModel

But without knowing your code I can't tell you more.

Cheers!
 
Share this answer
 
v2
Comments
Marcin Kozub 7-Dec-14 11:31am    
Why this answer was downvoted?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900