What is CSHTML

by John H
~1 minute

It is an HTML file that also renders ASP.net modules - creating dynamic code and making the HTML more of a template.  It provides handler mapping and will load the MVC engine.

The CSHTML extension tells ASP.net that there is code on that page that needs to be executed using the Razor view engine inside of ASP.net.

The markup is a "@" symbol followed by the variables or the code that needs to be executed.

If you've ever seen classic ASP.net calls like <% .... %> then basically the Razor syntax replaces those characters with a simple @ symbol

  • it is cleaner and saves some typing.

There are some other examples of the MVC engine with .vbhtml or the .aspx extension

Great article with examples

 

Related Articles

Why is Javascript so popular

The last 4 years has seen Javascript hotness like never before. You have a language that is native...

John H John H
4 minutes

PHP Sessions and SSL

I may want to make it so that I my php sessions last longer on a project that I'm working on right...

John H John H
~1 minute

PHP $_FILES array: Thoughts

I've been dealing with the Global $_FILES array recently.  It's a bear.  Here are some things to...

John H John H
~1 minute