[-] In ASP.Net MVC, URL is not mapped to physical files on the disk, they are mapped to controllers (classes in assembly) and action methods defined in the controller class.
[-] When you use MvcRouteHandler (default in ASP.NET MVC), you must provide value for routing parameter “controller” and “action”.
[-] routes.MapRoute: use routes.MapRoute method to register routes in RegisterRoutes method in Global.asax.cs. It’s better not to give name to route mappings.
[-] model binding: when an action method has a parameter with the same name of route parameter, the value of route parameter is automatically assigned to the action method parameter.
[-] Default parameter value and optional parameters
[-] URL pattern constraints: regular expression, HTTP methods
[-] Prioritizing Controller classes by namespace
[-] URL Pattern Wild Card
[-] URL pointing to static files on the file system will bypass the routing engine. But this can be changed by setting the RouteExistingFiles property flag.
[-] Using IgnoreRoute to define ULRs that will not go through route engine.
[-] Generating Hyperlinks (HTML a element) with Html.ActionLink(), the method taks controller and action name as parameter, and generates URLs based on the route collection.
[-] Performing Redirections to Generated URLs using RedirectToAction or RedirectToRoute
[-] Use Area to divide website into different sections.
[-] Generate Linking to an Action in same area, different area and root area.
[-] avoid Ambiguous Controller by add namespace to the root route entry.
ASP.Net MVC ULR Routing
October 17, 2010 by zhenglinet
Advertisement