We have a massive client facing web application here. We recently re-wrote the buy online experiance to make it quicker. My suggestion of using ASP.Net-MVC was not taken on board as I'm kinda the only one here that knows about it.
Now we are about to embark on redeveloping another section of the site and again I can't use MVC because no one here, no matter how many times you ask them, has bothered to research the framework.
Rather than be left behind and out in the cold again, I'd really like to re-write the sections in the MVC framework.
I think I could get away with it if I could mix WebForms and MVC but there seems to be little literature on the technique.
I'd need to be able to go to MVC pages from WebForm pages and vice-versa seamlessly.
Ive read this article and it's great but are there any more about?
Has anyone actually done this and deployed it successfuly? I'd like to hear any war stories, techniques, tips, tricks and gotchas.
I'm looking for as much literature as I can get my hands on so that when the project kicks off I can present a convincing case to the powers that be.
Thanks in advance.
Luckily, the answer is yes. Combining ASP.NET Webforms and ASP.NET MVC in one application is possible—in fact, it is quite easy. The reason for this is that the ASP.NET MVC framework has been built on top of ASP.NET.
To do this, right click you project and click Add> New Scaffolded Item… This will bring a dialog to choose the Controller class like below. Click “MVC 5 Controller – Empty”. Visual Studio will download and configure all the items for you to start working on MVC.
MVC is just a different implementation of the IHttpHandler interface so both classic ASP.NET and ASP.NET MVC pages can coexist in the same app. Show activity on this post. As you've probably noticed with the above answers, yes this is very possible to do.
ASP.NET Web Forms remains a popular framework for creating web apps. Even so, innovations in software development aren't slowing. All software developers need to stay abreast of new technologies and trends.
Chapter 12 in Professional ASP.NET MVC 1.0 is called Best of Both Worlds: Web Forms and MVC Together. It covers exactly the issue you raise. The good news is that there is not a lot to it. The book was written by team rock-stars Rob Conery, Scott Hanselman, Phil Haack, and Scott Guthrie. I found it instrumental when learning ASP.NET MVC.
Also, here's an article called Integrating ASP.Net MVC Into An Existing ASP.Net Web Application that discusses it.
UPDATE: Turns out that you can download a copy of the draft Best of Both Worlds chapter for free. This is an "Uncorrected Draft - Not Final Book Chapter" but might be worth checking out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With