How to mix WebForms and MVC in ASP.NET

20,339

Solution 1

Take a look at Scott Hanselman's blog article on this very topic:

Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications

Solution 2

You have to mention this line of code in the Global.asax file in the MVC application.

routes.IgnoreRoute("{WebPage}.aspx/{*pathInfo}");

This disables the MVC routing for the files of extension .aspx

Share:
20,339
user1478501
Author by

user1478501

Updated on October 01, 2020

Comments

  • user1478501
    user1478501 over 3 years

    I have an existing ASP.NET WebForms 3.0 application that works just fine. I upgraded it to ASP.NET 4 and it still works great, but now I want to add some ASP.NET MVC pages to it. I don't want to rewrite the application.

    Any suggestions? Can I mix them? How to work it? Any tutorials for me?