An awesome routing engine for ASP.NET MVC 3 and 4
Route.Paramattribute to have them handled as segments of the final URL.
<Website root>/cheap-packages/venice:
public class TravelController : Controller
{
[Route.Action("~/cheap-packages")]
public ActionResult FindPackages([Route.Param] string cityName)
{
// TODO: Make something useful
return Content("A fine travel can't be too cheap.");
}
}
<Website root>/cheap-packages/italy/veniceor
<Website root>/cheap-packages/italy/rome?includeHoaxes=true:
public class TravelController : Controller
{
[Route.Action("~/cheap-packages")]
public ActionResult FindPackages([Route.Param] string countryName,
[Route.Param] string cityName,
bool? includeHoaxes)
{
// TODO: Make something useful
return Content("A fine travel can't be too cheap.");
}
}
Route.Paramattribute, Cobisi SEO Extensions updates the visual feedback it previously added to the IDE and shows how the final route will look like.