I have a shared view in my _Layout.cshtml for my header named \"_Header.cshtml\".
I would like to display text and image from the database, so I need my controller t
... 1 year later would just like to add one thing to Dimitrov answer. You can make the controller a little cleaner:
public class MenuController : Controller
{
[ChildActionOnly]
public ActionResult Header()
{
var model = ... // go to the database and fetch a model
return Partial("_Header", model);
}
}