I'm developing a layout page in MVC application. The layout page has - Header - Content - Footer
Header has ogo, Welcome message, user info, several other links.
My question is, Should i design header as partial view or render it using Rendoraction. PartialView is working fine. But as this data does not depend on rest of the page, i want to call a controller action which returns a header view with its own model.
but HTML Rendor action is not working.
_Layout.cshtml
<body>
<div class="main_page">
<div id = "header">
*@Html.Partial("HeaderPartial", @Model)*@
@Html.Action("Header")
</div>
<div id="body">
@RenderBody()
</div>
<div id="footer">
</div>
</body>
HomeController
public ActionResult Header()
{
Var VModel = //Create Model;
return View(VModel)
}
header.cshtml
@model VModel
<div>
</div>
Error executing child request for handler
System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper