Chapter 2
Employing the Razor Markup Language
IN THIS CHAPTER
Understanding how Razor fits into the picture
Working with variables in Razor
Making decisions using Razor
Storing and cycling through data
As mentioned in Chapter 1 of this minibook, Razor is Microsoft’s language for implementing dynamic web content. While Chapter 1 shows how to create static content, most websites today use dynamic content so that updating them is easier. Using Razor is sort of like mixing C#, HTML, and some older technologies reminiscent of Active Server Pages (ASP) (https://docs.microsoft.com/en-us/troubleshoot/iis/asp-support-windows). The first part of this chapter discusses how this mix occurs and shows you some basics.
As with C#, any discussion of Razor needs to begin with using variables to store data. This means understanding the Razor data types, how to work with operators, and how to convert one data type to another. The information you obtained in Book 1, “The Basics of C# Sharp Programming,” and especially in Chapters 2 through 4, will help you in this minibook.
The next three parts of ...