About a year ago, I started to evaluate ASP.Net MVC, but decided to put it aside because it was still in heavy-duty development.  With the official release a couple of weeks ago, I decided to check it out once again.

MVC has a lot of things to offer, but there are a few critical things that we couldn’t overlook.  We have a few web applications that all have quite a lot invested in server controls (both third-party and developed in-house). 

In ASP.Net WebForms, for something as simple as a GridView with a ObjectDataSource, there is a lot handled behind the scenes.  The time it would take to mimic the necessary behavior in MVC appears to be unmanageable at this point.  I’ve done my share of HTML, and am comfortable doing it again, but it certainly feels like a step backward.  We would have to write a lot of HTML and JavaScript (with the help of jQuery) to accomplish what takes just a few lines with server controls.

Another issue that we cannot overcome is the fact that WebParts are basically server controls and are mostly incompatible with MVC.  One of our applications is highly dependent on WebParts.  Again, there is a lot of work handled for us by simply leveraging the WebPartManager.

So, it was easy to rule MVC out in regard to existing applications.  But, what about something new?  Well, for all the same reasons we’ve decided to stick with ASP.Net WebForms.  Basically, we have invested a lot in server controls, like menus, tree views, grid views, and in-house controls to promote common look and feel between our applications.  Moving to MVC would be no small task.

There is one place that I am considering MVC within our existing framework.  I’m wondering if we can leverage MVC to better handle our Ajax needs.  In a couple of occasions, we are using WebForms with no markup, that simply return xml data.  We also use Page Methods in a couple of places.  It seems like MVC could handle these types of requests more cleanly.

Perhaps in a few months the community will develop some slick MVC controls that save a lot of work.  Unfortunately, I don’t have the time (money) to build these controls myself.

Anyway, if I am totally off the mark, please someone pick me up and set me straight.

posted on Wednesday, April 1, 2009 3:37 PM


# re: Why I am not using ASP.Net MVC
posted by Travis
on 4/1/2009 5:10 PM
Can you Unit Test your webforms? I think that is the main reason MVC was created in the first place. However I am still learning so I could be far from correct.
# re: Why I am not using ASP.Net MVC
posted by Lee Brandt
on 4/1/2009 5:58 PM
I am in the same boat as far as heavy investment in server controls (ours are all Telerik). I'm not sure about WebParts, but we use an MVP pattern for our development. It gives us the same testability as MVC, with no lost ViewState. It has worked out wuite well on our projects so far.

Check Out David Hayden's article on MVP @ http://davidhayden.com/blog/dave/archive/2008/02/19/ASPNETModelViewPresenterUnityIoCMicrosoftPatternsPractices.aspx and JP Boodhoo's MSDN Mag article http://msdn.microsoft.com/en-us/magazine/cc188690.aspx .

Hope this helps ~Lee
# re: Why I am not using ASP.Net MVC
posted by Will
on 4/1/2009 10:11 PM

Actually, tomorrow I will be playing with WatiN and Selenium to try and get coverage over the UI. Otherwise we've got pretty good separation between the UI and the business logic and our business logic is well tested.


Thanks for the links. I'll check them out.

We are also implementing our own brand of MVP. With a BDD approach and healthy mocking we have very meaningful tests for our presenters. We still find bugs in the UI on occasion. This is why I will be checking out WatiN and Selenium tomorrow.

We are also using StructureMap to help manage our dependencies.
# re: Why I am not using ASP.Net MVC
posted by Jason Olson
on 4/2/2009 12:08 PM
Nope, I don't see any problem in this whatsoever Will. It's all about what suits you best. It's also another reason that MVC is not a replacement for WebForms. MVC isn't "the future of ASP.NET". If you need and want the complete and utter control over all things that MVC gives you, it's great. If you want drag-drop-just-make-it-work-so-I-can-go-home, WebForms is great (though that example is perhaps an over-simplification).

So, use the right tool for the right job, whether that be WebForms, Dynamic Data, MVC, or just plain HTML and AJAX.
# re: Why I am not using ASP.Net MVC
posted by Vincent
on 4/8/2009 5:54 AM
To Travis

Have you ever heard "NunitASP", it looks like you are lack of .net world
# re: Why I am not using ASP.Net MVC
posted by Imran
on 2/25/2010 5:05 AM
Actually I much prefer the mvc way as you have absolute control over the markup. The html source is clean and lean html. If you want controls that render things like grid data you can easily create a partial control (reusable component).
# re: Why I am not using ASP.Net MVC
posted by Savana
on 8/21/2010 7:42 AM
As far as I know, many people are using this feature and they are getting facilitated. There are some basic tutorials, It is a framework that can be beneficial. I work on MVC2 avail as a standalone framework that can be used with ASP.NET 3.5 SP1.

Post A Comment