I recently came across a command line tool, developed by Telerik, which allows you to convert Web Forms types MVC Views (ASPX, ASCX) to Razor CSHTML Views. You can find more information here. You may also download full source code from Git.
I did some small enhancements to this command line tool, and contributed to the project.
- Added GUI support.
- Select and convert multiple Views.
- Views filtering – You would only be able to select ASPX/ASCX Views.
- VS2010 integration – VS Extensions.
For most developers converting web forms Views to Razor is a once off task. So if you don’t like to have it part of VS Extensions, click here to download as a standalone tool.
Unfortunately this tool doesn’t support VBHTML. If you are interested to know more on VBHTML syntax, Jemison White has a nice blog post.
Here is another post by Scott Hanselman on Mixing Razor Views and Web Forms.