Adding Conditional Content
In this lesson, we will add conditional content to Razor templates.
We'll cover the following
Conditional statements
Sometimes filling holes in HTML with variable content is not enough to adapt the HTML to our data. We might need to include some HTML only if some conditions are met. A typical example is the proper handling of null
values or empty lists:
Get hands-on with 1400+ tech skills courses.