getting error , "dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel' "
Hi Experts
we are using controller of Umbraco.Web.Mvc.SurfaceController in MVC application like below
public ActionResult umbUploadImage() {
EditorInputModel obj = new EditorInputModel()
{
URLProfile = "test"
};
return View("umbUploadImage", obj);
}
when we call without master page like below
@model MVCWall.Models.EditorInputModel
@{
ViewBag.Title = "umbUploadImage";
}
it will run perfectly and i am able to browse the web.
But when we add Umbraco Master page like below the proble STARTS
@model MVCWall.Models.EditorInputModel
@{
ViewBag.Title = "umbUploadImage";
Layout = "~/Views/Wall.cshtml";
}
and when we run , it's throwing below error
The model item passed into the dictionary is of type 'MVCCreateWall.Models.EditorInputModel', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel' "
getting error , "dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel' "
Hi Experts
we are using controller of Umbraco.Web.Mvc.SurfaceController in MVC application like below
public ActionResult umbUploadImage() {
EditorInputModel obj = new EditorInputModel()
{
URLProfile = "test"
};
return View("umbUploadImage", obj);
}
when we call without master page like below
@model MVCWall.Models.EditorInputModel
@{
ViewBag.Title = "umbUploadImage";
}
it will run perfectly and i am able to browse the web.
But when we add Umbraco Master page like below the proble STARTS
@model MVCWall.Models.EditorInputModel
@{
ViewBag.Title = "umbUploadImage";
Layout = "~/Views/Wall.cshtml";
}
and when we run , it's throwing below error
The model item passed into the dictionary is of type 'MVCCreateWall.Models.EditorInputModel', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel' "
Can anyone please help me here ?
Thanks in advance
Rohan
Rohan,
Is your class EditorInputModel ineriting from RenderModel? If not then it needs to, also you will need to create an overloaded constructor for it e.g
is working on a reply...