Razor Views

Learning Objectives

By the end of this chapter, you should understand:

  1. The benefits of using templates
  2. How to create a template using a Razor View in an MVC application
  3. How to add iteration, conditionals, and forms to a template
  4. How to link a template to static resources like CSS stylesheets, scripts, images, etc.
  5. How to render a template using ASP.NET controllers

Key Terminology

Creating a Template

  1. Razor templates
  2. @
  3. View() method

Using a Template

  1. ViewBag

The Shared Directory

  1. Partial View