1
Reply

The model item passed into the dictionary is of type

Mark Tabor

Mark Tabor

Jan 9 2018 8:24 AM
119
I have a simple applicatin in which i have three class
 
customer
shirt
trouser
 
No I want to pull data from both shirt and trouser to a new view which show individual customer shirt and trouser measurement , for that i create a new class with name common
 
public class common
{
public int ID { get; set; }
public Shirt shirt { get; set; }
public Trouser trouser { get; set; }
public Customer customer { get; set; }
}
}
 
and i have create a new view in views/shirt folder with name detailslist and as model i am using common class so i found not compilation error
 
i am calling it like that
 
<td>
<a href="@Url.Action("DetailsList","Shirts",
new { id=item.Cutomer_ID })">View Details
</a>
</td>
 
but i am getting this below error can somebody help me
 
The model item passed into the dictionary is of type 'System.Data.Entity.DynamicProxies.Shirt_F1456FB361859F3EA477CB41E0439645AAB15410C25B21728EB0240FFA91F225', but this dictionary requires a model item of type 'AdminLteMvc.Models.common'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more inf

Answers (1)