2.conventional Based Routing
2.conventional Based Routing
4.
5. Now, the question that should come to your mind is, we have not
explicitly defined any routing rules for the application. Then how is this
mapping done, i.e., how is the /Home/Index URL mapped to the Index
action method, and how is the /Home/Details/2 URL mapped to the
Details action method of the Home Controller class?
6. This is done by the MVC Routing Middleware Component, which we
registered into the Request Processing Pipeline application. (if case we
use the Asp.net core Web Mode-View_Controller Template).
(Conventional Routing ) Without MVC Template
Step => 1
Step => 2
Give Project name as Routing_Without_MVC , and then click on Next
Step => 3
Select .Net 6.0 Framework, and then click on Create .
Step => 4
o In this “Asp.net Core Empty” Template we will not get the Folders like
Models, Views, Controllers , wwwroot….etc
2. Add a Controller:
Step => 1
Step => 2
Give Project name as Routing_With_MVC , and then click on Next
Step => 3
Select .Net 6.0 Framework, and then click on Create .
Step => 4
o In this “Asp.net Core web (Model -View-Controller)” Template we will
get the Folders like
Models, Views, Controllers , wwwroot….etc
4. Next, we want to access the Details of the action method for the Student
Controller using the following URL.
https://localhost:44359/StudentDetails/10