I have a website built using a MVC.NET framework with C# that uses some shared views and partial views. In order to display the views properly there is a bit of code that must reside in the controller. Currently I have that logic duplicated between controllers.
An example would be an view that takes in an error id and then pulls down the record from the database and formats the view differently based on the error type. There is a small amount of work that needs to be done to the data in the controller before it can be displayed.
If the view is in the Shared directory where would the controller for it go? Or, is it better design to create a new controller just for it?
I am trying to choose a design that will prevent the "controller creep" that we had in a prior project.
Update: I am currently learning about MVC using Razor and learned about the HTML.Action extension method. If I were going to go back and rewrite this project I would put the method into a "Shared" controller and use HTML.Action to format the data to display it on what ever screen I needed it.