Asp – Problem mixing webforms into ASP.NET MVC application

asp.netasp.net-mvc

I've been trying with the idea of taking an existing ASP.NET Webforms application and converting it to a hybrid so that going forward, we can do ASP.NET MVC.

In order to do this, I created an ASP.NET MVC application and started copying some of the folders from the ASP.NET webforms projects that contain webforms. I'm having a problem building the resulting project getting hundreds of compile errors of this form:

Error   1951    'Documents_Admin_DocPushByTag' does not contain a definition for
'CtlCategoryList' and no extension method 'CtlCategoryList' accepting a first argument 
of type 'Documents_Admin_DocPushByTag' could be found (are you missing a using directive
or an assembly reference?)

Each of these error messages refer to server controls in my markup. It's as if the mark-up is not getting parsed? When I edit one of the code behind files and type this. to see what intellisense recognizes, these controls don't appear. The event handlers do (but that must be because they are defined in the code behind file). As far as I can tell, the CodeFile and Inherits Page attributes are correct (and unchanged from the ASP.NET project from whence they came). I'm mystified what is causing this problem. Any ideas? TIA.

Best Answer

check out how scott hanselman does it:
http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx

basicallly, you'd use ignoreroute to exclude all of your webforms from being routed to an mvc handler