So I would like to share some of my thoughts on MVC, why it doesn’t do what most people think it does, and why the parts of it that make sense, can be easily implemented using our open source extension 2SexyContent.
So what is ASP.net MVC, and what not
- ASP.net MVC is about separating content (Model) from functionality (Controller)
- ASP.net MVC is about separating content (Model) from design (View) typically using Razor
- ASP.net MVC is about controlling your HTML and producing exactly the HTML that you want, without the ClientID and other quicks used in ASP.net Forms
- ASP.net MVC is about providing nice URLs without question marks pointing to specific records in a data base (Routing)
- ASP.net MVC often uses (what I call) your Context – usually the information you are looking at – and then does everything around it based on this Context. So based on what I selected (the Content/Model in the Route/URL) it – the Controller – then chooses how to display it (View)
I guess ASP.net MVC does a few other things, but IMHO the main reason people tend to use it is to control the HTML-output. And believe me: I know of almost nobody that really uses it, even though magazines and book authors try to suggest otherwise.
So of the things it does, here’s how you get MVC with DotNetNuke
Since I’m sticking to my claim, that almost everybody only wants MVC because of it’s HTML-Control, and usually doesn’t really appreciate the extra complexity of splitting everything up into fragments of functionality and views. And if HTML-Control is what you want, you can use one of the generic data-tools and get all the control you need. The ones we’ve used and can recommend:
- XMod or XMod Pro (very powerfull, popular, uses own syntax) – ideal for lot’s of data, input forms, processes etc. – so mainly stuff that is data-oriented
- Form and Lists (free, hard to use because it uses XSLT) – ideal for smaller data base-type things, lists and more. Not as powerfull, and unfortunately not updated since 2010 :( but free.
- 2SexyContent (our favorite🙂 – ideal for non-list kind of output like designed content elements, beautiful and animated content and more. Our favorite feature is the use of Razor🙂 – the preferred MVC-View engine.
I believe that all the (real) benefits of MVC – in this case the output-oriented, perfect-control etc. aspecs can be gotten easily and painlessly. If you think otherwise, please let me know🙂.