Skip to main content

Posts

Showing posts with the label Attribute based routing

What Is ASP.NET MVC Routing ?

What Is Routing? The MCV Routing is a pattern matching system that matches  all browser’s incoming requests  to the  registered URL patterns  residing in the  RouteTable . When the MVC application starts, it registers  patterns  to the  RouteTable  to tell the  routing engine  to give a  response to the requests  that  match these patterns . An application has only one  RouteTable . Routes can be configured in  RouteConfig  class. Multiple custom routes can also be configured. The route must be registered in  Application_Start  event in the  Global.ascx.cs  file. Each MVC application has default routing for the default  HomeController . We can also set custom routing and the  RouteConfig  class. The three segments that is important for routing is  - {controller}/{action}/{id} RouteConfig class An example for Register Routes - public class ...