I want to get information or data of tables and
and show in partial view. Now my action for Partial View is
<pre lang="xml">public ActionResult _ListPartialNavbarPageGroup() {
var db = new eShopMVCEntities();
var Query = (from title in db.PageGroups
select title).ToList();
return View(Query.AsEnumerable());
}</pre>
and my partial view page is
<using System.Data
@model IEnumerable<eshopfull.models.pagegroups>
@foreach (var item in Model)
{
- @Html.ActionLink(@item.PageGroupTitle, "ListNavbarPageGroup", "Pages", new { Id = @item.PageGroupID }, null)
}
>
and may layout call this partialview
< @Html.Partial("~/Views/PageGroups/_ListPartialNavbarPageGroup.cshtml",new PageGroups())>
Now .... I Call Home page . Home page include top partial view ..
may home conroller and index is ...
public ActionResult Index()
{
return View();
}
but Error
<of type 'System.Collections.Generic.IEnumerable`1[EshopFull.Models.PageGroups]'.
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 'EshopFull.Models.PageGroups', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[EshopFull.Models.PageGroups]'.
Source Error:
Line 67: // *@
Line 68:
Line 69: @Html.Partial("~/Views/PageGroups/_ListPartialNavbarPageGroup.cshtml",new PageGroups())
Line 70:
Line 71:
>
please Help me . please :( :'( :'( :'(