MVC Views: Homepage Tabs

Home tab
BookStore3/Views/Home/Index.cshtml (default)

Privacy tab
BookStore3/Views/Home/Privacy.cshtml (default)

Books tab
To make the tab works, add the following code to the controller file HomeController.cs:
   public IActionResult Books( ) {
     return RedirectToAction( "Index", "Books" );
   }
The tab will bring the user to the folder Views/Books, which includes the following Razor pages:

  • BookStore3/Views/Books/Create.cshtml (generated by EF)
  • BookStore3/Views/Books/Delete.cshtml (generated by EF)
  • BookStore3/Views/Books/Details.cshtml (generated by EF)
  • BookStore3/Views/Books/Edit.cshtml (generated by EF)
  • BookStore3/Views/Books/Index.cshtml (generated by EF)

Clicking on the tab, the page Books/Index.cshtml will be shown.

Authors tab
To make the tab works, add the following code to the controller file HomeController.cs:
   public IActionResult Authors( ) {
     return RedirectToAction( "Index", "Authors" );
   }
The tab will bring the user to the folder Views/Authors, which includes the following Razor pages:

  • BookStore3/Views/Authors/Create.cshtml (generated by EF)
  • BookStore3/Views/Authors/Delete.cshtml (generated by EF)
  • BookStore3/Views/Authors/Details.cshtml (generated by EF)
  • BookStore3/Views/Authors/Edit.cshtml (generated by EF)
  • BookStore3/Views/Authors/Index.cshtml (generated by EF)

Clicking on the tab, the page Authors/Index.cshtml will be shown.



      What did one wall say to the other?    
      “I’ll meet you at the corner.”