Routing in ASP .Net MVC

Routing is a pattern matching system which identifies the incoming request and decides what to do with that request. So the usual process will be carried out by this mechanism is that it maps the URL to a particular method (action) on a particular controller. The actions gets executed and returns an instance of ActionResult which handles the logic for rendering the HTML content in user's browser.

At run time the routing engine matches the incoming request URL pattern against the URL patterns defined in the Route table and process that accordingly.

Defining Route

A typical MVC project defines a 'Global.asax' file, which contains a single method 'Application_Start' within which various calls are made to various configuration methods to set up the application's working state. One of these calls is to the 'RegisterRoutes' method of the 'RouteConfig' class found in the 'App_Start' folder of the project which is responsible for configuring the routes for the application.




Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Today's enterprise datacenter can be one of the most complex business environments with dozens (for smaller business), hundreds (for larger and midsize business), even thousands (for hyperscale businesses) of servers that must be managed and monitored. At this level, just managing the cords can be challenging — let alone keeping up with the growing need for more agility and scalability within the datacenter. Simply put, companies are aggressively looking for less complexity and more agility from their …

  • Featuring Kate Leggett, VP and Principal Analyst, Forrester Research Live Event Date: October 19, 2016 @ 10 AM PT / 1 PM ET Omnichannel self-service is the new paradigm. Firms are organizing to provide self-service options across all channels in order to meet customer needs and expectations—going beyond traditional IVR. Are you prepared to offer your customers personalized self-service across all channels including legacy applications like your IVR?

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date