I work on a product which up to this point has been using the web forms view engine for all its views. There are far too many files to refactor.
Is there any reason why I cannot use razor and the web forms view engine in the same project?
ASP.NET MVC supports the use of both the Razor and WebForms views in the same project with the default configuration.
The default View engine will search for a view in this order
~/Views/Home/Index.aspx (WebForms)
~/Views/Shared/Index.aspx (WebForms)
~/Views/Home/Index.cshtml (Razor)
~/Views/Shared/Index.cshtml (Razor)
So if you have a WebForms and Razor view of the same name then the WebForms view will be shown.
Scott Hansleman has more details on mixing WebForms and Razor views in one layout/master page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With