Yogesh Ghorpade

Yogesh Ghorpade

  • NA
  • 762
  • 148.2k

asp.net mvc Can i have one view for multiple action methods

Mar 16 2018 3:58 AM
I have set up a menu-controller to drive the top menu links based on which other controller is being used. Each other controller has a separate nested master page for each of its views.
 
so, i have a menu-controller with several methods that return viewresults, one per each controller, or "section" of the site. So currently each of these methods has its own view to render the menu. but each view to render the menu is the same code, the only thing that changes is the logic in the controller methods based on which links to render.
 
is there any way to have all of these controller actions target the same view? since the view is the same for all?

Answers (3)