How do I render an alternate child view in MVC?

If you don't mind reusing (or duplicating) some code I'd probably just make a new action to deal with this I don't think I would change the action to pass in another parameter (the action already is taking 2: a jobId and a boolean). You'd probably have to change existing code somewhere to account for a third parameter Assuming the action is just giving you a list of records I don't see how adding a new action with one line of LINQ (or however you are getting data) would offend the DRY... especially if it makes the code easier to maintain by not mixing too many functions in one action. If its too offensive, then you can refactor the actions to call some common method.

If you don't mind reusing (or duplicating) some code I'd probably just make a new action to deal with this. I don't think I would change the action to pass in another parameter (the action already is taking 2: a jobId and a boolean). You'd probably have to change existing code somewhere to account for a third parameter.

Assuming the action is just giving you a list of records I don't see how adding a new action with one line of LINQ (or however you are getting data) would offend the DRY... especially if it makes the code easier to maintain by not mixing too many functions in one action. If its too offensive, then you can refactor the actions to call some common method.

In your Action method if (isList) return PartialView("List"); else return PartialView("AssignImage").

It seems like I should be able to just ask for the data somehow from the controller and let the the view determine the layout... maybe I am thinking about it backwards/traditional asp. Net way. – Jeff Martin Dec 22 '09 at 18:35 1 Yes, the action determines the View.

The View, according to the MVC pattern, should be very stupid and not make determinations like that. – Yuriy Faktorovich Dec 22 '09 at 18:38.

If you don't mind reusing (or duplicating) some code I'd probably just make a new action to deal with this.

I am very new to MVC. I have an Html. Grid with some column in it.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions