Project Description
Extension for ASP.NET MVC.
This project helps MVC developers to simplify route management in web application.
Using this extension you can represent your route as a class and use OOP principals to create hierarchy of routes.
 This extension helps to solve following problems:

  1. Avoid hardcoding action names, controller names, area names.
  2. Easy route refactoring.
  3. Generate link to action(another route) based on current route.
  4. Easily create multilingual websites powered with MVC 

Avoid hardcoding action names, controller names, area names.

Instead of writing

Html.ActionLink("My link text", "MyAction", "MyController")

you can write

Html.ActionLink<MyRoute>("My link text")

where MyRoute is your class which represents a route.

Easy route refactoring.

When you generate link to you action with extra parameters like

Html.ActionLink("My link text", "MyAction", "MyController", new {PageNo = 1})

it's easy to get your link broken when you rename parameter 'PageNo' to (for example) 'Page'.
Using this extension your link generation will look like

Html.ActionLink("My link text", null, new MyRoute{PageNo=1})

Whenever you refactor your class your link in the view will be refactored as well. If you enable view complilation and for some reason after refactoring you link generation in the view is not refactored then you will get compilation error. Idea here is to find broken link as soon as possible preventing broken links in production.

Generate link to action(another route) based on current route.

Last edited Mar 20, 2012 at 3:29 PM by zavand, version 13