HI,
I am beginner for MVC 4 so, i have an issue while retrieving the data from database.I am gettitng the error like this may i know where exactly i am facing this issue.This is the error i am getting.
The model item passed into the dictionary is of type 'JeevesBO.ServiceBO', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[JeevesBO.ServiceBO]'.
Actually this is my code in controller.
public ActionResult ViewDetails(ServiceBO ServiceBO)
{
string partialView = null;
try
{
var valid = TryUpdateModel(ServiceBO);
objServiceBLL.SelectServiceByCaseID(ServiceBO);
if (valid)
{
objServiceBO._CaseID = "4I1-367BASC01-416003";
partialView = RenderPartialViewToString("_ViewDetails", objServiceBLL.SelectServiceByCaseID(objServiceBO));
//Messagedis = "Successfully Inserted";
}
}
catch (Exception ex)
{
return Json(new { Valid = false, Message = Messagedis, PatialView = partialView, status = 0 });
}
return Json(new { Valid = true, Message = Messagedis, PatialView = partialView, status = 1 });
}
This is views ViewDetails.cshtml part.@model JeevesBO.ServiceBO
Customer Name | Mobile Phone | HomePhone |
|---|---|---|
Email | Address | LandMark |
@Html.DisplayFor(modelItem => item._CourierName) | @Html.DisplayFor(modelItem => item._MobilePhone) | @Html.DisplayFor(modelItem => item._HomePhone) |
@Html.DisplayFor(modelItem => item._Email) | @Html.DisplayFor(modelItem => item._Address) | @Html.DisplayFor(modelItem => item._Landmark) |
Index Part Index.cshtml
@model IEnumerable
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
Index
@{Html.RenderPartial("~/Views/ViewCall/_ViewCallDetails.cshtml", new List { new JeevesBO.ServiceBO() });}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Ravi PatelPosted Dec 17, 2015, 12:48 AM