9

I am required to deliver a component, inlcuding business logic and UI, to be used on a ASP.NET MVC 3 web site that is being developed by other company.

I know my way around ASP.NET WebForms server controls and how to package and distribute them to be reused across projects. I also have experience with MVC approach in general and some ASP.NET MVC experience. I did read over materials recommending use of HTML helpers and similar, but most of this deals with only UI reusability or reusability inside a single ASP.NET MVC project. I did not find any mentions of how to package and distribute such functionality for ASP.NET MVC.

The business logic is major part of this component. It is supposed to be a kind of wizard, which progresses through a lot of steps and which would also work with database using Entity Framework and send an email to the user upon completion.

  • How would I go about creating a control/component that encapsulates complex business logic and also renders its own UI/view output and that would be distributable in form of a standalone assembly? Is this even possible or only to some extend?

  • Would this somehow be doable by wrapping model, view and controller inside an assembly?

  • Or would it be better to approach this just as a complex model? If so, how would it be possible to connect the UI/view and controller to this component by the consumer of the component?

I also did see a couple of vendors out there, such as Telerik, who sell something along the lines of ASP.NET MVC controls/components, so I assume this is somehow possible to do.

famousgarkin
  • 13,687
  • 5
  • 58
  • 74
  • 3
    I think this is what you are looking for. http://stackoverflow.com/questions/6656843/how-to-reuse-areas-controllers-views-models-routes-in-multiple-apps-or-websi – Valamas Nov 11 '11 at 11:39

2 Answers2

3

This article tells how to call controllers from another assemblies.

To reuse only views, you can use RazorGenerator.

rcaval
  • 762
  • 5
  • 12
  • 1
    I'm currently using RazorGenerator to stick common views in our common library, and it really does the trick. You could wrap everything you are looking to do into a single assembly and be good to go. – IronicMuffin Dec 29 '11 at 14:47
2

I recommend you to refer the MVC Control ToolKit Project page of CodePlex

Also see ASP.Net MVC Sprite Project

Prasanth
  • 3,029
  • 31
  • 44