---
title: "What are the Main Razor Syntax Rules?"  
description: "What are the Main Razor Syntax Rules?"  
author: "Manish Kumar"  
published: 2017-05-17  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/23251/what-are-the-main-razor-syntax-rules  
category: "c#"  
tags: ["c#", "mvc4"]  
reading_time: 1 minute  

---

# What are the Main Razor Syntax Rules?

MVC Razor code blocks are enclosed in @{ ... }\

In Razor Inline expressions (variables and functions) start with @

Code statements end with semicolon

Variables are declared with the var keyword

Strings are enclosed with quotation marks

C# code is case sensitive

C# files have the extension .cshtml

## Answers

### Answer by Manish Kumar

MVC Razor code blocks are enclosed in @{ ... }\

In Razor Inline expressions (variables and functions) start with @

Code statements end with semicolon

Variables are declared with the var keyword

Strings are enclosed with quotation marks

C# code is case sensitive

C# files have the extension .cshtml


---

Original Source: https://www.mindstick.com/interview/23251/what-are-the-main-razor-syntax-rules

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
