Razor Views

Razor Views: Passing a Model to a View, Razor Syntax and Tag Helpers.

Updated

  1. Passing a Model to a View (Journeyman): An action hands its view a model with View(model); the view names the model's type with @model and reads it through Model. ViewData carries small extras, such as the page title.
  2. Razor Syntax and Tag Helpers (Journeyman): Mix C# into HTML with Razor's @ expressions, code blocks, if and foreach, and let tag helpers such as asp-action and asp-route-id write your links.