Skip to content

Instantly share code, notes, and snippets.

@goenning
Created December 3, 2011 11:03
Show Gist options
  • Save goenning/1426872 to your computer and use it in GitHub Desktop.
Save goenning/1426872 to your computer and use it in GitHub Desktop.
Example of how to use SubdomainRoute class
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Admin"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.Routes.Add("Admin_Home", new SubdomainRoute(
"admin",
"",
new { area = this.AreaName, controller = "Home", action = "Index" },
new string[] { "SubdomainRouting.Areas.Admin.Controllers" }
));
context.Routes.Add("Admin_Login", new SubdomainRoute(
"admin",
"login",
new { area = this.AreaName, controller = "Login", action = "Index" },
new string[] { "SubdomainRouting.Areas.Admin.Controllers" }
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment