Question: The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[Onclickmuseum.Models.PackageModel]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Onclickmuseum.Models.AuctionModel]'.
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[Onclickmuseum.Models.PackageModel]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Onclickmuseum.Models.AuctionModel]'.

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.

Stack Trace:

[InvalidOperationException: The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[Onclickmuseum.Models.PackageModel]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Onclickmuseum.Models.AuctionModel]'.]
 System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value) +378
 System.Web.Mvc.ViewDataDictionary.set_Model(Object value) +47
 System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary) +614
 System.Web.Mvc.ViewDataDictionary`1..ctor(ViewDataDictionary viewDataDictionary) +37
 System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData) +98
 System.Web.Mvc.WebViewPage.set\_ViewData(ViewDataDictionary value) +38
 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +458
 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +382

Answer: 
The exception error message is pretty clear. You have a view or partial which is strongly typed to:

```
@model IEnumerable<Onclickmuseum.Models.AuctionModel>

```

but your controller action passed a `List<Onclickmuseum.Models.PackageModel>` to it. Make sure that your controller action is passing to the view a model which is of the correct type.

Alternatively, if this is inside some partial that you are rendering from your main view using the `Html.Partial` helper, make sure that in addition to passing the partial view name as first parameter, you are also passing a model as second parameter which is of the correct type. If you do not pass a second argument to the Html.Partial helper, then the model of the main view will be passed to it, which might not be of the same type.
```
**Controller file of this index page**

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Onclickmuseum.Models;
using System.Data;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace Onclickmuseum.Controllers
{
    public class AuctionController : Controller
    {
        //
        // GET: /Auction/
        private OCMContext db = new OCMContext();
        public ActionResult Index()
        {
            ViewBag.CategoryId = new SelectList(db.CategoryModels, "CategoryId", "CategoryName");
            ViewBag.SubcategoryId = new SelectList(db.SubcategoryModels, "SubcategoryId", "SubcategoryName");
            return View();
        }

        [HttpPost]
        public ActionResult Index(AuctionModel auction)
        {
            if(ModelState.IsValid)
            {
                db.Entry(auction).State = EntityState.Added;
                db.SaveChanges();
            }
            return RedirectToAction("Index");
        }

        public ActionResult Search()
        {
            return View(db.PackageModels.ToList());
        }

    }
}

```