views:

287

answers:

2

I'm developing a web application for a company which I work for. My team started working on the app few months ago and the decision was to build it with ASP.NET WebForms. Now we've quite a lot of the code developed and we're wondering if ASP.NET WebForms was a good choice. Maybe we should migrate. Ok, but what's the first step? We don't want to rewrite everything from scratch. We'd like to add a new stuff in MVC and rewrite the old part in the future (gradually). Is it possible to add somehow ASP.NET MVC application to current WebForms one? Can they live together?

+5  A: 

Asp.net webforms and MVC can live happily together. You will add some includes and directores and add a route which will cause your webforms pages to be ignored. All explained here:

http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc

Palantir
hey, you stole my link! ;-P
Razzie
Hey, come back and give me my link back! :P the interface says I answered before you did :P
Palantir
OK, now I'm fair. :)
rafek
+4  A: 

Mixing MVC with webforms is not that all hard. Basically, you want to ignore any exisiting .aspx routes in your global.asax, and then add routes for new pages that you want to build using MVC.

See this article for more details.

Razzie
As I can see.. Razzie answered first. :)
rafek
to be fair, I think Palantir was like 30 seconds before me, but I won't complain... :)
Razzie
AAH! I'll be downvoting your all for eternity!!! :P (just joking of course) :)
Palantir
@Razzie.. yea u're right, I'll change accepted answer. :) Sorry for inconvenience.
rafek