Skip to content

Instantly share code, notes, and snippets.

@timgthomas
Created January 31, 2012 16:55
Show Gist options
  • Save timgthomas/1711566 to your computer and use it in GitHub Desktop.
Save timgthomas/1711566 to your computer and use it in GitHub Desktop.
DoddleReport with MVC Areas
using System.Web.Mvc;
using DoddleReport.Web;
namespace Product.Web.Areas.Admin
{
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Admin"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
// Any idea why this doesn't work...
context.MapReportingRoute();
// ...but this, effectively identical call, does?
context.MapRoute("Admin_DoddleReport", "Admin/{controller}/{action}.{extension}/{*pathInfo}", null, new { extension = new ReportRouteConstraint() });
// (This is the default route for this area.)
context.MapRoute("Admin_default", "Admin/{controller}/{action}/{id}", new { action = "Index", controller = "Home", id = UrlParameter.Optional });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment