Adding the Index view

At the top of the file, we set the ViewData to Title. We saw what this did back when we looked at _Layout.cshtml, but it's worth repeating that the value that we set here is used to help build the title in our master layout page. When we run our application, this sets the title to Home Page - AdvancedTypeScript 3 - Discogs:

@{  ViewData["Title"] = "Home Page";}

The user interacts with our application through a search control. It's time for us to add it in. We are going to add a div ID, which we will call pageRoot, that will contain a form element:

<div id="pageRoot">  <form asp-controller="Home" asp-action="Index" class="form-inline">  </form></div>

Again, we can see that we are using the full power of ASP.NET to our advantage ...

Get Advanced TypeScript Programming Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.