Hello,
i have method to pass the data from Data access method to controller
when i load the page with parameter value 1 it gives following error
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BussinessObject.UserBO]', but this dictionary requires a model item of type 'BussinessObject.UserBO'.
public ActionResult Edit()
{
var id = HttpContext.Request.RequestContext.RouteData.Values["id"];
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
//UserBO userBO = userbl.fetchbl();
IList<UserBO> objAddressDetails = new List<UserBO>();
objAddressDetails = userbl.fetchbl(int.Parse(id.ToString()));
if (objAddressDetails == null)
{
return HttpNotFound();
}
return View(objAddressDetails);
}
Edit html page which has strongly type model with Userbo class
@model BussinessObject.UserBO
@{
ViewBag.Title = "Edit";
}
<h2>Edit</h2>
@using (Html.BeginForm())
{
......
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
pls advice