Asp – Building pages with multiple views

asp.net-mvc

I'm looking to build an ASP.NET MVC application where many screens will have multiple distinct views. Ideally the user would be able to bring the items they require into their workspace page in a portal style. Even if that is not possible, there would need to be a number of common items joined in various ways for various classes of user: something difficult to achieve with traditional inheritance.

It seems to me that the URL structure allows for only one controller to instantiated and for this to bring up one view at a time (and only one) – not place multiple views on a page. Searching here I have seen reference to MVC Contrib subcontrollers, but I can't see them on the http://www.codeplex.com/MVCContrib site to check them out any further?

Would subcontrollers be the way to go ? If so, where do I find them now. If not, what would you suggest ?

Best Answer

If you want to stick with using asp.net mvc then you can work with partial views which will/should give you the "web part" type functionality which it sounds like you want. You can then limit the which partial views you want to see depending on permissions etc. on the main page views (this could be exposed via a base controller class or something).

I've done a little searching and have come up with a few links which you might find useful ...

Jeffrey Palermo - Talks about templating partial views

Rob Conery - using user controls with asp.net mvc

mikesdotnetting.com - ASP.NET MVC Partial Views and Strongly Typed Custom ViewModels (not read all of this, but it looks pretty usefu)

Hope this helps.

Related Topic