Is it possible to re-use controllers in ASP MVC? And if so how?
Perhaps re-use isn't the right word. The situation is I have a menu and sub menu navigation bars as shown below (actually there is another nav bar what is shown)- I know the colour scheme needs some work
The upper bar is populated from a database, so there could be more or less than 3 plans.
The lower bar always has the same three entries. The views for each of these entries are the same regardless of which plan is selected, though they are different from each other. Obviously the data within them is different (populated from different tables).
That is Plan A -> Suggested Points
view is the same as Plan B -> Suggested Points
view.
But Plan A -> Suggested Points
view is not same as Plan A -> Accepted Points
view
In order to do this with the views I intend to use partial views, so the same view files can be re-used.
However, how can I do the equivalent for the controllers?
What I would like if for url paths such as: /PlanA/SuggestedPoints /PlanB/SuggestedPoints
To my mind I just want the Plan
links to set a variable that tells the Points
views which database they should hook up to. Which may be the wrong way to think of it and I suspect is incompatible with the url path suggestion above.