Todd Earhart

Todd Earhart

  • NA
  • 5
  • 528

MVC5 layout template, change partial page based upon body

Mar 10 2017 3:01 PM
I have an MVC5 project in VS 2013.  It is using a layout template with sections for the following:
 
  1. Header
  2. Nav Bar
  3. Side Bar
  4. Body
 The header, nav bar, and side bar are rendedred with Partial Pages.
 
Here is the problem I wish to solve.
 
I have multiple buttons in the Nav bar.  Based upon the button clicked, the body will change to that particular page.  But I also want the Side Bar to change as well as the content of the side bar will vary based upon the page displayed in the body.
 
Nav Bar buttons : Log Call, Update Claim, Search
The body will change to the appropriate page.  This already works.
The Side Bar should display differently based upon the Nav Bar button selected, or the page it will be displaying in the body.
(NOTE:  The SideBar is used for actions which can change for each different body page.)
 
How can I make this happen? 

Answers (2)