0

I've seen a lot of articles creating hybrid Web Forms applications to also have MVC pages and those work fine.

Unfortunately, I've inherited a Web Forms Web Site (not application), so there is no way to edit project files, add references, etc.

How do I use Webforms alongside ASP.NET MVC when the project is a Web Site project?

George Stocker
  • 57,289
  • 29
  • 176
  • 237
Mark Kadlec
  • 8,036
  • 17
  • 60
  • 96

2 Answers2

1

It's actually pretty easy to convert a web project to a web application. And from there you can use the 2013 web application project to have webforms, webapi, and mvc all live and play along in the same application.

However, take a look at ASP.Net vNext. They have removed webforms from that model and are using asp.net webpages much like what you are using now. That will be able to work with webapi and mvc so you might want to start learning that instead of converting to see if the programming model fits your upgrade path a little better.

TombMedia
  • 1,962
  • 2
  • 22
  • 27
1

There is a way to convert a website into an application:

How To Convert ASP.NET Website to ASP.NET Web Application

Scott Hanselman also created a NuGet package for adding MVC into a Webforms application:

https://www.nuget.org/packages/AddMvc3ToWebForms/

Community
  • 1
  • 1
Jeremy Bell
  • 698
  • 5
  • 9
  • We're all the way up to mvc 5 now. Lots has changed since then, probably better to find more recent articles. – TombMedia Sep 01 '14 at 08:23
  • 1
    Correct. Given the current position of the OP, I didn't think jumping straight to Mvc5 was the easiest route. However, once you do get to MVC 3, just updating the Nuget packages to the latest version will get you all the way up to the latest. – Jeremy Bell Sep 05 '14 at 19:56