In the _ViewStart
Set Layout = null or mark it.
@{
Layout = null; //Layout = "~/Views/Shared/_Layout.cshtml";
}
In the _Layout.cshtml
Use @Html.Action(actionName, controllerName) <div id="header">
@Html.Action("HeadMenu", "Home")
</div>
In the Controller
public class HomeController : Controller
{
public ActionResult HeadMen()
{
//TODO something...
return View();
}
}
http://weblogs.asp.net/scottgu/asp-net-mvc-3-layouts
沒有留言:
張貼留言