Unlike some other routing extensions out there, the IT Cloud Web Routing system does not define any custom routing handlers. When it discovers routing attributes on your classes and methods, it adds the routes using the APIs in System.Web.Routing. What this means is that you can use existing MVC helper APIs for generating outbound links and they will just work.

Note: the following examples are in Razor (.cshtml) syntax

To create an outbound link using MVC controller and action:
@Html.ActionLink("Our Blog", "Index", "Blog")

The above ActionLink will emit the Path you specified on the UrlRoute attribute on the BlogController.Index method.

To create an outbound link based on a route name:
@Html.RouteLink("Contact Us", "contactform")

The above RouteLink call will emit the Path for the UrlRoute with the Name "contactform". This also works for generating links to WebForm pages with the UrlPageRoute attribute.




Last edited Apr 2, 2011 at 8:22 AM by ds7, version 3

Comments

No comments yet.