6

How does one create a .cshtml page in an ASP.NET web application? The option to choose Razor is obvious when using MVC - it appears when adding a view. But I can't seem to figure out how to accomplish this in a plain ASP.NET Web Application. Is it even possible?

1 Answer 1

5

Create an HTML file and rename it to CSHTML.

Although Razor pages don't appear in the Add New Item list, they work fine in normal web projects.

Sign up to request clarification or add additional context in comments.

4 Comments

mine says no compiler is registered for .cshtml
@Maslow: You need to install MVC3.
it says I have it, it was installed 5 days ago in my programs and features section. version 3.0.20105.0. also Mvc3 Tools update 3.0.20406.0. and finally Asp.net web pages 1.0.20105.0
Try installing or repairing VS SP1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.