Skip to main content

Posts

Showing posts from 2013

How is Routing done in ASP.Net MVC

How routing is done in asp.net mvc Each route contains the following info, 1. the url 2. the curly braces that specify the match 3. the constraints for the inputs in the url parameters Each route should be anything that inherits from the RouteBase. **************** foreach route in the routescollection do, { 1. The url in the route should match the incoming url 2. The contents for the curly braces must match in the incoming url 3. The constraints should also match with the route taken from the routes collection. 4. If a match occurs, then the route is considered as a valid one } for every route match to be done, the routebase supplies the URL, the curlybrace dictionary with its replacement from the request URL, route parameter values with the optional ones for which no value was received from the i/p request. 3. The route handler is passed with the requestContext [url, cookies, authentication data, request data etc] once a first route match is done, the routing me