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
- Razor blocks
- Multiline line statements
Syntax
Razor block code can have both combinations of C# and HTML language codes.
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.