Reputation: 826
Is there a way to have a web site with some pages in ASP .NET MVC project and other (legacy pages) in ASP .NET Webforms in a way that the navigation is quite transparent to the final user?
Also, what happends with the URL?
I can't use a mix of web forms and mvc in the same project (althought i know it's possible)
I want to use this approach to make the transition from web forms to mvc easier and whenever a new page is added put that page on the mvc project without affecting the current web forms working project.
Upvotes: 3
Views: 878
Reputation: 2284
Upvotes: 0
Reputation: 239290
Not really. One project = one website. You can technically deploy one or the other as a virtual application under the other, but this would still be two separate websites. They'd come up under the same domain/subdomain, but they would not be able to communicate with each other in terms of routing and such, i.e. there would be no way to get a URL for something in your MVC project from your Web Forms project.
MVC is backwards-compatible with Web Forms, so that you can migrate over to MVC in-place. In other words, you can add the MVC Nuget packages to a Web Forms project and start working with MVC in that same project while maintaining your existing Web Forms pages. That is how you do an upgrade. If you don't want to do it that way, your MVC site will have to be its own thing, hosted separately.
Upvotes: 4