Reputation: 82291
My company is standardizing on 3 different development models for our client code (we use web services for the business layer code):
Our goal is to be able to make changes and new apps quickly via re-use. I have done a lot of research into WPF and SharePoint 2010. WPF has Prism and SharePoint has WebParts (both of these allow reuse of UI components).
But we are planning to send a fair amount of the development to the ASP.NET MVC methodology. Much of this work will have common UI pieces. Since I have not done much research on ASP.NET MVC, I am hoping someone out there can enlighten me.
How is UI reuse done in ASP.NET MVC? (Meaning what is the Prism or WebParts of ASP.NET MVC?)
Upvotes: 2
Views: 1928
Reputation: 16174
The first part of sharing UI between projects is the controllers, which is easy enough - inherit from a base controller in your shared library, and all the actions in that will work as if they were defined in each project.
You also need views of course, which is a bit harder. You need to either copy the view files into each project or set them up as embedded resources. It takes a bit of work to set up, but it can be done - see Views in separate assemblies in ASP.NET MVC
Upvotes: 1
Reputation: 13083
In MVC you have Partials. Partial controls (ASCX files) that you can render via various means:
and then with Razor View Engine that comes in MVC 3 there will be new options like Layouts and Sections.
Upvotes: 2