---
title: "What is Razor View Engine in Asp.Net mvc?"  
description: "What is Razor View Engine in Asp.Net mvc?"  
author: "Anonymous User"  
published: 2020-02-04  
updated: 2020-02-04  
canonical: https://www.mindstick.com/forum/155781/what-is-razor-view-engine-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 2 minutes  

---

# What is Razor View Engine in Asp.Net mvc?

[Briefly describe](https://www.mindstick.com/interview/22943/briefly-describe-android-application-architecture) about razor [view engine](https://www.mindstick.com/forum/155782/explain-different-types-of-block-statements-in-razor-view-engine) with a suitable example.

## Replies

### Reply by Nishi Tiwari

[Razor view](https://www.mindstick.com/forum/155820/how-to-generate-textbox-control-using-htmlhelper-in-razor-view) [engine](https://www.mindstick.com/interview/33775/what-is-a-javascript-engine) in asp.net MVC is defined as a syntax that allows us to write server-side code on view. **[Razor helps to combine code and Html in a fluid manner.](https://www.mindstick.com/forum/155775/define-different-folder-structure-in-asp-dot-net-mvc)** It is not a new programming language if we know C#, Vb.Net and bit HTML we can easily write Razor code. It supports C# and Visual Basic programming languages.

A Razor syntax is based on C# programming language and the code statements in Razor end with a semicolon (;) which would be shown below.

## Syntax of Razor View Engine

Usually, in razor view engine code blocks are enclosed in "@{ ... }". This “@” is a character that tells the beginning of Razor syntax. These codes can be a single expression or an entire code block. This syntax represents razor view engine declaration in asp.net MVC

```
@{

//Razor block

}
```

The above code "@{"a character tells the beginning of the block and "}" a character tells the ending of the block.

## Declaring a variable in Razor View

We will declare the razor view engine as shown below:-

```
@{
var weekDay = DateTime.Now.DayOfWeek;
}
```

![What is Razor View Engine in Asp.Net mvc?](https://www.mindstick.com/mindstickforums/b240b9e5-21b1-4e4d-8d74-a019819d7de5/images/6d19829b-6ec5-4f2b-9e32-d28fb5f30b50.jpeg)


---

Original Source: https://www.mindstick.com/forum/155781/what-is-razor-view-engine-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
