This is more of a architect question rather than one that requires code.
I have a page that requires me to display the status of a particular project. Let's say for the sake or brevity that there are two states, Open and Closed.
When the project is open I want to display a PartialView showing me one set of details. If the project is Closed I want to show a PartialView with different details.
Now I know I could do a check in the aspx and render one or the other but I'm trying to cut down on the number of decision points within the aspx code. I believe that there should be a minimum of actual code within the aspx.
Also, there are more then two states so the "if" statements would pile up and become messy.
Has anyone tackled something like this?
Should I create a Helper to do this? Can I, and I'm unsure how to do this, handle this in the ActionResult of the view? So for example, can I render the PartialViews in the action result and return that as part of the normal view?