我在左侧有一个带有修复菜单的页面。此部分视图需要不同的模型作为主页(内容)。
母版页/布局:
<body>
<div id="IndexMenu">
<div id="IndexMenuInner">@RenderPage("~/Views/Admin/part/_Menu.cshtml", new { LocationAdminModelCollection = new Model; })</div>
</div>
<div id="BodyContent">
@RenderBody()
</div>
开始时调用的索引/内容页面:
@model Survey.WebApplication.Models.ChecklistDetailsModel
@{
ViewBag.Title = "Survey Administration";
Layout = "~/Views/Admin/_Layout.cshtml";
}
<link href="@Url.Content("~/Content/Admin/Menu.css")" rel="stylesheet" type="text/css" />
<div id="IndexSubMenu">sub_Menu</div>
<div>
<div id="IndexMenuInner"></div>
</div>
我的菜单:
@model Survey.WebApplication.Models.LocationAdminModelCollection
@{
Layout = null;
}
<div class="menuLocation">
</div>
我可以这样做吗?