I have three controllers with three actions:
- List
- View
- Info
The only difference between controllers are selected layout and url.
First i used RenderPartial – but it is still a lot of code duplication (mainly in actions).
So i want in some way to avoid this – for example create only one controller and configurate routes, so it choices right layout for different urls.
how come controller defines your layout? this is a bad practice. remember that in MVC the VIEW layer is for defining the layout.
Each view file can override default shared Layout file with
and you can provide that value dynamically with ViewBag for example.