Computer Magic Logo

Saturday, August 8, 2015

Published by Aristotelis Pitaridis

Razor is a programming syntax which is used in conjunction by ASP.NET in order to generate dynamic web pages. Razor released by Microsoft in January 2011 with Visual Studio 2010 and ASP.NET MVC 3.

In the beginning when Microsoft introduced ASP.NET, in order to generate dynamic contents in a web page we could combine HTML contents with source code by using the <%= %> Symbols in order to define a code block but with Razor we use the @ character which does not require opening and closing of the code block.

The reason that Microsoft changed the way that we write server side code in our web pages is because we had to use a better syntax and make the code easier to read. With Razor we can have IntelliSense.

There are a lot of things that we can say about the Razor syntax but in this tutorial we will see the basics so that we will understand how it works in order to use it with Umbraco.