Web
Analytics
Routing in MVC | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

What is Routing:

Routes maps controllers names and their actions names. It is used to create user friendly URL.To setup startup page just like web forms. The routing system lets you create any pattern of URLs you desire and express them in a clear and concise manner.

Map Route Functions.  It has collections of routes and invokes routes.

MVC-Routing

Need of Routing:

Old URL pattern:

www.OnlineShop.com/Mobiles.aspx?catId=8

www.OnlineShop.com/Mobiles.aspx?catId=9

www.OnlineShop.com/Mobiles.aspx?catId=15

 

MVC application:

www.OnlineShop.com/Mobiles/Samsung

www.OnlineShop.com/Mobiles/Motorola

www.OnlineShop.com/Mobiles/Micromax

 

Benefits :

  1. SEO friendly Application : Simplify URL
  2. Non hackable URL’s: It’s not returning actual file name. No physical file
  3. Prevents from inaccessible and secured files access
  4. Ignore routes are used to prevent specific routes like web.config, XML file, Image file etc.

 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);

DownLoad Source Code