What’s new in ASP.NET MVC 5 Part-1 : Attribute Routing

added by jalpesh
5/18/2014 4:22:27 AM


SP.NET MVC is a new buzz word in Microsoft.NET stack most of people have started learning into it. So recently before some time Microsoft has released a Major new version of ASP.NET MVC with ASP.NET MVC 5.x. There are lots of new features given with ASP.NET MVC 5.x versions and I’m going to write a few series of blog post to explain all the features in details. So stay tuned with that!! In this blog post I’m going to explain attribute routing in ASP.NET MVC 5. Routing in ASP.NET MVC: From the first version of ASP.NET MVC It’s provides a routing out of box. You don’t need to do much about it. Routing is how ASP.NET MVC matches URL in browsers to action. Based on URL a particular action is called on particular controller and result will be provided as view. Till ASP.NET MVC 4.0, all routing was done using RouteCollection. If you need to do a routing you need to define a route collection in your RouteConfig file provided in App_Start folder in RegisterRoute static method. This method was called in Application_start event in ASP.NET MVC. This is how the Register Route looks in ASP.NET MVC 4.0.