3
votes

I currently work for a company that uses a combination of ASP.NET Webforms and legacy ASP pages for web development. This works fairly well for their current projects but I would like to convince / suggest to them to switch over to ASP.NET MVC since most of their codebase consists of wiring form elements to stored procedure parameters. Just using an ORM is also a possibility but I think it would be a good idea to use this opportunity to switch to an MVC framework.

However, I'm not sure how easy it will be to deploy an ASP.NET MVC app along side ASP.NET and Classic ASP code while the codebase is updated. First, I would like to ask if this is even possible. I've seen threads about running ASP.NET with Classic ASP and ASP.NET MVC with Webforms but not all three in the same application. They currently have Webforms and Classic ASP working together so the pitfalls associated with that are already solved. Second, what are some strong selling points that would help me convince the rest of the team that learning a new framework and converting existing code will be worth it in the long run?

2
See stackoverflow.com/questions/539123/… - probably not a duplicate, but it might help.ChrisF♦
For me, separation of concerns has always been a big win for MVC over webforms.Dan Atkinson

2 Answers

8
votes

I see this is an old question, but since I'm in the same boat I thought I'd give it a shot.

I've got a 100k+ page site written in Classic ASP over the past 12-15 years. Unlike a lot of hacked-together code, it's well structured, complicated, and efficient, and has been refined to such a degree that bugs are very, very rare.

A lot of the new features that were added over the past three or four years were implemented in ASP.NET. This has required reimplementing a lot of the underlying DAL and business logic, and, of course, the new stuff is never as stable as the code that's been running without a hitch for close to a decade. It's also very, very nice to keep the source off of the server and away from prying eyes and fingers.

I resisted MVC at first, but I've come to love it. It doesn't offer all of the features of Webforms - easily packaged and redistributable user controls is something that I really, really miss - but it's much more traditional app development than web development, which I like. It's also significantly easier to write tests for - a huge selling point for me.

So, the current Visual Studio solution looks like this:

  • a bunch of .NET class libraries (DAL, etc)
  • an ASP web application project containing all of the old code and all of the webforms stuff
  • an MVC web application project.

IIS is pointed to the MVC project folder, so all of the MVC stuff just works as expected. The website configuration includes virtual folders for all of the ASP stuff that hasn't been migrated (this will take years). Those virtual directories point to a folder outside of the MVC folder structure where the Webforms and Classic ASP code/objects are stored. When IIS receives a request, things that are mapped to the virtual folders are processed by classic ASP or the webforms, while everything else is routed to the appropriate MVC area.

I keep these projects separated intentionally; having a single solution with ASP, MVC and webforms all in the same folder structure is a sure path to insanity.

It works quite well, but was a bit of a pain to get configured at the get go.

So, yes, all three technologies will happily exist in the same site, but you've got some organizational challenges ahead of you.

1
votes

It is possible to run a site that is partially standard Asp.net as well as Asp.net Mvc. As for classic ASP, I've never done it, but I imagine if it runs alongside standard Asp.NET, then MVC won't be an issue.

As for why, remind them that classic ASP isn't a desirable skill in the marketplace. Some people will always resist change and new technology (because the old stuff works fine, and they are probably right). Find the developers that are eager to trade up in skill sets, and get them to band together. But make sure MVC makes sense for the application. Management is likely to wonder why they need to make the big time investment to upgrade when the old stuff is working just fine, and that will be a harder sell.