The razor view engine, which first appeared in ASP.NET MVC 3, is massive step forward for web technologies and has become the defacto standard for MVC. Many templating engines (WebForms/ASPX, Python, etc) put the burden on the programmer to to separate code and markup.
Razor is different. It puts the burden on the tooling and allows for smooth and simple transitions with minimal fuss. For example, we could output the time using the following razor syntax:
<span>Welcome, the time is @DateTime.Now.ToShortTimeString()!</span>
And the output would be something like:
Welcome, the time is 12:24 PM!
Being fluent in Razor syntax is a basic requirement of being an MVC developer. That's what this task is all about!
Before you get started, keep in mind that this is only the beginning for Razor. We will cover composite / partial views, layouts, sections, etc. in subsequent tasks. Let's get to it!
GK Digital is an online, collaborative learning platform built from the ground up to be a superior learning experience on the web. It is self-paced and yet supported by both your peers and instructors. We have reimagined what learning should be in a world full of public information such as blogs, YouTube, etc. GK Digital is professional training in the 21st century.