Just over six weeks ago Shaun published a blog called “DNN Labs: Project MaVeriCk”, where he indicated that we had initiated a project to look at supporting ASP.NET MVC development in DNN. I have spent about 25% of my time over the last six weeks on this project. There are really two objectives to Project MaVeriCK:
- Can we create a completely new MVC based Platform that will enable us to move forward on future versions of ASP.NET?
- Can we enable developers to create Modules using ASP.NET MVC today that will work within the current DNN Platform?
About the Name
The capitalization of the name “MaVeriCK” is important as it represents M-V-C on Project K. Project K was the working code name of the recently announced ASP.NET vNext which will only support ASP.NET MVC, Web API and SignalR - no Web Forms - the technology on which we have built DNN.
However, there is a second reason for the name for me personally. Back in the early days of MVC my son, Andrew, who had just started working at Microsoft and had been a member of the “DNN Core Team” developed a prototype that he called Maverick (for similar reasons). While not built directly for DNN, this was a simple multi-tenant web platform in the style of DNN, and with his permission I have used many of the ideas he proposed as a starting point for my work so far on the first goal.
The Project Goals
Let’s take a look in more detail at the project goals. The following picture shows the proposed structure of an MVC- based Architecture for DNN.
In this Architecture, we continue to support a multi-tenant solution, and the specific tenant (portal) is identified as part of the MVC Routing. Once the tenant portal and page are identified a Razor skin (cshtml) will be loaded which will in turn load the MVC Apps.
This architecture is identical in approach to how we use Web Forms today, except for the technology upon which it is based (i.e. MVC vs WebForms). In future blogs I will go into more technical detail on how we are approaching each of the steps, but I do already have a very basic working prototype that includes routing, multi-tenancy and Razor-based MVC Apps (or modules), and uses the existing DNN API. This prototype will connect to and work with a previously installed DNN database.
The second goal of this project is to bridge the gap to the MVC future by enabling the use of MVC modules side by side with Web Forms. This goal is a little more challenging as we have to merge the technologies. Developing a clean MVC-based Platform is relatively straightforward - supporting Web Form modules and MVC modules in the same application is much more challenging.
Our initial thought in this area was to put the WebForms pipeline side-by-side with the MVC pipeline as shown in the second image.
This approach keeps the MVC and WebForms pipelines separate - all the complex work to decide whether to use WebForms or MVC is in the URL Routing. The request is then routed to a pure MVC pipeline or a pure Web Forms pipeline.
Initial research in this area suggests that this approach is feasible. The cons to this approach, however are that Page Level components such as Control Panel and Page Settings would need to be re-written in MVC ,as well as key Module components like Module Actions and Module Settings.
Another approach to meeting the second goal is to support MVC Apps (modules) in the current Web Forms pipeline, by hosting the MVC app in a Web Form control. I am currently doing some research in this area, and it is initially quite promising. The work required to make this functional should be much less.
Given recent changes in the technical team at DNN Corp, I am now the prime contact with the Microsoft ASP.NET team, and we are working closely with the that team to ensure we have a compelling story when they release the next version of ASP.NET. I will keep you posted on our progress.