ASP.NET Razor - Markup
Razor is not a programming language. It is a server-side markup language.
What is Razor?
Razor is a markup syntax that allows you to embed server-based code (Visual Basic and C#) into web pages.
Server-based code can create dynamic web content when a web page is sent to the browser. When a web page is requested, the server executes the server-based code within the page before returning the page to the browser. Through server execution, the code can perform complex tasks, such as accessing databases.
Razor is built on ASP.NET and is designed for creating web applications. It has the features of traditional ASP.NET, but is easier to use and learn.
Razor Syntax
Razor uses syntax similar to PHP and classic ASP.
Razor:
PHP:
Web Forms (classic ASP):
Razor Helpers
ASP.NET Helpers are components that can be accessed with a few lines of simple Razor code.
You can build your own helpers using Razor syntax, or use built-in ASP.NET helpers.
Here are brief descriptions of some useful Razor helpers:
- Web Grid
- Web Graphics
- Google Analytics
- Facebook Integration
- Twitter Integration
- Sending Email
- Validation
Razor Programming Languages
Razor supports C# (C sharp) and VB (Visual Basic).