Articles → ASP.NET CORE → Routing In Asp.Net Core

Routing In Asp.Net Core






Routing The Asp.Net MVC Application





Routing In Asp.Net Core




RuleURLDescription
Routes are mapped to physical view files (without extension)http://localhost/indexThe URL is mapped to the physical file "index.cshtml".
"Index.cshtml" is the default documenthttp://localhostThe URL is mapped to "index.cshtml".
Folder name is added in the URLhttp://localhost/Admin/privacyThe URL is mapped to "privacy.cshtml" inside the "Admin" folder.



How Is Routing Configured In Startup.Cs?




Picture showing the structure of areas in the asp.net core project
Click to Enlarge



  1. Creating an area
  2. Views and Controllers on the root of the project folder


Picture showing the routes added in the startup.cs file
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, February 17, 2021
 
Updated On  -  Monday, June 14, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250