I want to display 4 different lists from 4 different tables, I created a Partial View
for 4 tables in their respected controller, but its not getting rendered, its giving an error;
The model item passed into the dictionary is of type 'Medical_App.Models.MA_Area', but this > dictionary requires a model item of type > 'System.Collections.Generic.IEnumerable`1[Medical_App.Models.MA_Area]'.
If there is another way / alternative of doing this, please share.
public PartialViewResult AreaList()
{
var result = db.MA_Area.OrderBy(d => d.AreaName);
return PartialView(result);
}
@model IEnumerable<Medical_App.Models.MA_Area>
@Html.DisplayNameFor(model => model.CityId)
@Html.DisplayNameFor(model => model.AreaName)
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.CityId)
</td>
<td>
@Html.DisplayFor(modelItem => item.AreaName)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.AreaId }) |
@Html.ActionLink("Details", "Details", new { id=item.AreaId }) |
@Html.ActionLink("Delete", "Delete", new { id=item.AreaId })
</td>
</tr>
}