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.http://localhost/indexThe URL maps to the physical file index.cshtml.
Index.cshtml is the default document.http://localhostThe URL maps to the physical file index.cshtml.
The folder name is added to the URL.http://localhost/Admin/privacyThe URL is assigned to privacy.cshtml within 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 are in 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