Ive really searched all over the web and im just stack on this problem.. pls help :( (new with MVC) when im trying to run a specific page , im getting the message:
System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Data.Entity.DynamicProxies.Category_B85D1A3F838C0192719C683B1095328267C570F7A660F0D', but this dictionary requires a model item of type 'Leeoriyas.Models.Category'.
my controller "storecontroller" (the relevent part)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Leeoriyas.Models;
namespace Leeoriyas.Controllers
public class StoreController : Controller
{
LeeoriyasFPEntities storeDB = new LeeoriyasFPEntities();
// GET: Store
public ActionResult Index()
{
return View(storeDB.Category.ToList());
}
public ActionResult Browse(string Category)
{
var categoryModel = storeDB.Category.Include("ArtS").Single(c => c.Name == Category);
return View(categoryModel);
}
my view (browse)
@model Leeoriyas.Models.Category
@{
ViewBag.Title = "Browse";
}
<h2>Browsing category: @Model.Name</h2>
<ul>
@foreach (var product in Model.ArtS)
{
<li>
@product.Title
</li>
}
</ul>
thanks!! :(