In this blog, I want to share some important notes on RazorEngine in ASP.NET MVC5
- MVC5 uses view engine to allow using Razor inside MVC Web Application to build HTML output.
- Razor coding is a combination of C#.NET or VB.NET and HTML design
- We use languages to get the data and generate the output.
- Easy to use, to learn, and to work with in real time environment scenarios.
- Razor Expressions
- Single line C# Statement
Syntax
- <p>@ViewBag.Name </p>
- Razor blocks
- Multiline line statements
Syntax
Razor block code can have both combinations of C# and HTML language codes.- @{
- //statement(s)
- .....
- }
for example.
Output
@ Symbol uses in razor engine to write the code, as shown below.
@Html.ActionLink (“SignIn’,”Account”);
The main advantage of RazorEngine prevents cross-site scripting attacks like <> before rendering to view.
Thanks for reading my blog.

Pravas RanjanPosted Feb 10, 2017, 12:48 AM
Hello Prem Bhai please add more article like this and thank you for your effort here to deliver this kind of valuable information to us..... Thanks again...........