ASP.NET RazorLesson 19Free preview
Razor Intro
This lesson is part of ASP · All levels
Summary
Razor is the template syntax that is the core of ASP.NET Web Pages, allowing C# or VB.NET server code to be written alongside HTML in a single .cshtml file. Razor is designed to be concise so that HTML writing stays clean without much of an opening and closing mark. Razor code is always executed on the server so the browser only accepts results in HTML.
Key points
- Razor uses the .cshtml extension for C# and .vbhtml for VB.NET.
- The @ sign marks the server code, while the rest is rendered as HTML.
- Execution takes place on the server, not the visitor's browser.
- Razor generates a regular HTML so that the result can be opened by any browser.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.