hello ,
as far as i know about MapControllerRoute() that it define route Template and there crosponding pattern and the register them to the route table, my question regarding adding route template to the route table as an example if i am using convintional routing and i have a controller for Home and another one for Studentes which so the route template for the first one will be `/Home/Index` and the other will be `/students/index `are those the route template that will be registered to the route table or /{controller}/{action}/{id?}

Tuhin PaulPosted Oct 12, 2024, 5:36 PM
Indexaction, the generated URL will be/Home/Index.Indexaction, the generated URL will be/Students/Index.These URLs are generated dynamically according to the defined route pattern (
{controller}/{action}/{id?}), meaning the route table does not register the specific routes/Home/Indexand/Students/Indexdirectly. Instead, the route table contains the pattern{controller}/{action}/{id?}, and it will match incoming requests to the actual controllers and actions using this pattern.Tuhin PaulPosted Oct 12, 2024, 5:32 PM
In ASP.NET MVC,
MapRouteis used to define a route template and its corresponding handler. When you use conventional routing, the route template/Home/Indexand/Students/Indexare not directly registered to the route table.Instead, the route template
{controller}/{action}/{id?}is registered, which is a generic pattern that matches multiple routes, including/Home/Indexand/Students/Index.