MVC Views: Homepage Tabs

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

Privacy tab
BookStore1/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:

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

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



      I said to the gym instructor:    
      “Can you teach me to do the splits?”    
      He said: “How flexible are you?”    
      I said: “I can’t make Tuesdays.”    
      — Tommy Cooper