Creating a view

To create a view, we first need to create the matching folder if it doesn't already exist, and then create the file. Follow these steps to accomplish that:

  1. On Solution Explorer, right-click on the project name and choose Add | New Folder.
  2. Set the name as Views and click Enter.
  3. Right-click on the newly created Views directory and, again, choose Add | New Folder.
  4. Set the new folder name as Home and click Enter.
  5. Right-click on the new Home folder and choose Add | View....

On the Add View dialog, do the following:

  1. Set the View name as Index.
  2. Choose Empty (without model) on the Template field.
  3. Uncheck the Use a layout page checkbox.
  1. Click Add:
  1. The new view has now been scaffolded for you.
  2. Find the <body></body> tags and ...

Get Hands-On Full-Stack Web Development with ASP.NET Core 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.