Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What Happens if routing is not there in MVC ? What is the Importance of Routing in MVC ?
Posted

The routing is an important and "vital" feature of ASP.NET MVC.

In the next two articles you can find detailed answers to your question about routing:
Routing in MVC [^]
Customizing Routes in ASP.NET MVC[^]
 
Share this answer
 
routing is starting page in webapplication.

If you set about is your starting page you will change controller name About instead of Home


C#
public static void RegisterRoutes(RouteCollection routes)
 {
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

     routes.MapRoute(
         name: "Default",
         url: "{controller}/{action}/{id}",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
     );
 }


Changed: defaults: new { controller = "About", action = "Index", id = UrlParameter.Optional }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900