1

I am Using ASP.NET C# MVC.

I have a Table in Database Where I kept Layout Settings (Site name , Header text etc).With Log in I want to Show this on Appropriate place in _Layout view.

What I am doing & want is I want to have a "View Model" Bind in _layout view With some Data (data comes from a action => service layer => data Layer).

Where i should give hand ?? what can I do ?

Ahmed Zamil
  • 238
  • 2
  • 6
  • 17
  • One method: Create a base controller from which all other controllers inherit from, and populate some custom "ViewBag"/"ViewData" properties within that class (e.g. `OnActionExecuting`). Arguably kind of hacky though. – Brad Christie Jul 07 '14 at 14:12
  • 2
    This is a good situation where you can use Html.RenderAction in your _layout view to call a partial view. There must be hundreds of tutorial examples of this. – markpsmith Jul 07 '14 at 14:20

1 Answers1

-1

Do you want to define a _layout page for you application which should have fixed sections like header, footer and then a middle section where different pages can populate them self. There are many examples on the web related to this. Search on Google "ASP.NET MVC layout pages". If you have any specific problem implementing any of those solutions, please post the question and people should be able to answer those.

inquisitive
  • 549
  • 4
  • 7