2

OK so I have a large .NET 4.0 webforms solution with many projects. I want to develop a new set of screens in MVC3 that integrate into the site. Do I need to change the webconfig and routing in the existing webforms (web application) root? That seems risky. Can I just add an MVC3 project and integrate that into the web application? What's the easiest, least risky way? Does all the routing have to be done at the root? Also, we use NCache for state management. Thanks.

1 Answer 1

3

There is nothing about the "solution" that is webforms, so yes, you can add an MVC project to the solution. If you want to add MVC3 components to an existing webforms project, you can do that, too, but you will have to do some of the work the MVC3 project wizard does for you, like adding routes in global.asax.cs and making some web.config changes. Once complete, a hybrid webforms/MVC3 application works fine.

My recommendation, if you want to go this route, is to create an MVC application and look at the things that it puts into the Global.asax.cs file and the web.config file and compare that to your current application.

Check out http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx for a good primer.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Joe, yes I understand it is possible. I've read those same articles. My confusion/question though is do I have to change the routing and webconfig at the existing Root of the webforms application? Can I essentially leave the rest of the site alone?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.