Skip to Main Content
.NET Core 2.0 By Example
book

.NET Core 2.0 By Example

by Neha Shrivastava, Rishabh Verma
March 2018
Beginner to intermediate content levelBeginner to intermediate
458 pages
10h 34m
English
Packt Publishing
Content preview from .NET Core 2.0 By Example

Razor primer

Razor is a markup syntax for embedding server-based code in a web page. Developers familiar with PHP will find themselves at home while working with Razor, as the syntax is very similar. Razor syntax consists of Razor markup, C#, and HTML. Since it contains C# as well as HTML, files containing Razor syntax generally have a .cshtml extension. The @ symbol is of great importance in Razor syntax and it is used to transition from HTML to C#. OK! But how does Razor work?  A .cshtml file can have Razor, C#, and HTML. The server first runs the Razor markup and C#, which ultimately would translate into HTML that the browser can understand and render. This HTML is then combined with the remaining HTML content and sent back to the browser. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core 3 and React

ASP.NET Core 3 and React

Carl Rippon
Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu

Publisher Resources

ISBN: 9781788395090Supplemental Content