I’m in a situation where I have to create a project that’s a mixture of ASP.Net MVC and Web Forms. Fitting Web Form files in the neat structure of MVC is breaking my heart. Right now I’m putting the forms in a sub folder under Content. Is this the only/logical way to go about this? It would make more sense to put them in Views folder but they are not accessible there. Need your expert advise on how to go about this.
Share
I have been many times in a situation where I had to make an existing WebForms application interoperate with an ASP.NET MVC application. In fact the objective always was to rewrite this application to MVC but since it was so large it had to be done in multiple steps and for a certain amount of time the two had to interoperate. In all those situations I have never mixed the 2 in the same project. I had always created a separate clean ASP.NET MVC application and made the 2 talk using standard HTTP/HTML methods: anchors, forms, cookies.
But if in your situation you really need to mix the 2 inside the same application I guess that your existing WebForms application already has an established folder structure that you don’t want to modify when introducing the MVC structure. I would keep this folder structure as-is. he Views folder should indeed be reserved for MVC views only. You might put the legacy WebForms in some subfolder of the root.