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

  • On-demand Event Event Date: March 23, 2017 As you adopt the use of cloud services, whether in public/IaaS, SaaS or hybrid environments, the attack surface expands and, if breached, the costs increase exponentially. This session is designed to help IT and security leaders understand and address the unique challenges that enterprises typically face when they deploy their applications in the public cloud. It summarizes the areas that the public cloud vendors typically take care of and highlights the areas …

  • The open source cloud computing project OpenStack has come a long way since NASA and Rackspace launched it in 2010. Backed by leading technology infrastructure providers including Cisco, Dell, EMC, HP, IBM, Intel, and VMware, OpenStack underpins significant workloads at an increasingly diverse set of organizations, including BWM, CERN, Comcast, eBay, and Wal-Mart. For CIOs engaged in broader programs to win, serve, and retain customers -- and refocus business technology (BT) spend -- a planned and pragmatic …

Most Popular Programming Stories

More for Developers

RSS Feeds

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