You can create a hybrid webforms - MVC application.
For this you need:
- copy the MVC configuration from web.config of the new MVC project into your WebForms application. web.config
- create standard MVC 4 folders (at least Views, Controllers)
- reference the necessary assemblies
- copy the web.config file from the MVC project view to the WebForms project. Views Folder
- change the routing configuration to ignore routes, including .aspx / .ascx, so that they are processed by web forms and not MVC (do this also for .ashx, .asmx or any other web form artifacts)
So you have one ASP.NET application that supports MVC and WebForms, and uses the same authentication, session, etc.
Then you can do this integration: - create pages that are fully MVC or fully webforms. If you use master pages, you need to create a main page for web forms and a layout for MVC (it can be very difficult or quite simple, depending on its content and design) - create a web form page and integrate MVC pages using partial representations of AJAX and MVC
Aprt frommy comments, this blog post will help you a lot: Integrating ASP.NET MVC 3 into existing updated ASP.NET 4 Web Forms applications
By the way, this is not theoretical ... I have a web application with a lot of pages, areas and views that uses this technique and works flawlessly. I had to redo the design of the main page (layout and CSS) so that both types of pages look the same. I was fortunate enough to have a menu created in the webforms placeholder using an SQL XML query and XSLT, so reusing it in an MVC layout was absolutely simple. You can do something like this on the main page and the MVC layout (I mean visualizing the HTML manually and using it on both pages so that it runs only once)
You can take some time to get it working, but it's worth the effort.
source share