FileInfo

Languages

Overview

What is a CSHTML file? A CSHTML file is a C# HTML webpage file used by Razor, an ASP.NET view engine that generates webpages. It is similar to a standard ASP.NET webpage ( .ASP or .ASPX file) but uses slightly different syntax. CSHTML files run on a web server, which generates HTML for a client web browser.

More Information CSHTML file open in Microsoft Visual Studio Code CSHTML files are similar to .VBHTML (Visual Basic HTML) files. However, they use syntax that is closer to the C# language than the Visual Basic language. One easy way to recognize a CSHTML file is to look for @ symbols that precede Razor reserved directives and code blocks. CSHTML files use the @ symbol and Razor reserved directives to transition from HTML markup to C# code. Most CSHTML files are created in Microsoft Visual Studio . Visual Studio provides syntax highlighting and Intellisense code suggestions that help developers create CSHTML files. NOTE: Razor offers additional templating syntax operations besides those supported by the standard ASP.NET MVC default view engine.

Popularity4.1/5

45 votes

Quick AppUsed by
VerifiedVerified by FileInfo.com The FileInfo.com team has independently researched the ASP.NET Razor Webpage file format and Mac, Windows, and Linux apps listed on this page. Our goal is 100% accuracy and we only publish information about file types that we have verified. If you would like to suggest any additions or updates to this page, please let us know .

Microsoft Visual Studio 2012 Icon

Breadcrumbs

DeveloperMicrosoft
Popularity4.1 | 45 Votes

Previous / Next

In-Depth

.CSHTML File Extension

ASP.NET Razor Webpage

DeveloperMicrosoft
Popularity
4.1  |  45 Votes
 

What is a CSHTML file?

A CSHTML file is a C# HTML webpage file used by Razor, an ASP.NET view engine that generates webpages. It is similar to a standard ASP.NET webpage ( .ASP or .ASPX file) but uses slightly different syntax. CSHTML files run on a web server, which generates HTML for a client web browser.

More Information

CSHTML file open in Microsoft Visual Studio Code

CSHTML files are similar to .VBHTML (Visual Basic HTML) files. However, they use syntax that is closer to the C# language than the Visual Basic language.

One easy way to recognize a CSHTML file is to look for @ symbols that precede Razor reserved directives and code blocks. CSHTML files use the @ symbol and Razor reserved directives to transition from HTML markup to C# code.

Most CSHTML files are created in Microsoft Visual Studio . Visual Studio provides syntax highlighting and Intellisense code suggestions that help developers create CSHTML files.

NOTE: Razor offers additional templating syntax operations besides those supported by the standard ASP.NET MVC default view engine.

How to open a CSHTML file

You can open and edit a CSHTML file in any text or source code editor. Source code editors, such as Microsoft Visual Studio Code (cross-platform) and GitHub Atom (cross-platform), contain helpful features that make reviewing and editing CSHTML files easier.

Open over 400 file formats with File Viewer Plus . Free Download

Programs that open or reference CSHTML files

Sort

Pricing

Program Name

Platform

Reset

X

Windows

Microsoft Visual Studio 2022

Free +

Microsoft Visual Studio Code

Free

GitHub Atom

Discontinued

Free

Any text editor

Mac

Microsoft Visual Studio Code

Free

GitHub Atom

Discontinued

Free

Any text editor

Linux

Microsoft Visual Studio Code

Free

GitHub Atom

Discontinued

Free

Any text editor

Chrome OS

Google Chrome Text

Included with OS

Category: Web Files

Updated: October 26, 2021

FAQ

What is a CSHTML file?
A CSHTML file is a C# HTML webpage file used by Razor, an ASP.NET view engine that generates webpages. It is similar to a standard ASP.NET webpage (.ASP or .ASPX file) but uses slightly different syntax. CSHTML files run on a web server, which generates HTML for a client web browser.
How do I open a .cshtml file?
You can open and edit a CSHTML file in any text or source code editor. Source code editors, such as Microsoft Visual Studio Code (cross-platform) and GitHub Atom (cross-platform), contain helpful features that make reviewing and editing CSHTML files easier.