Created
December 3, 2011 11:03
-
-
Save goenning/1426872 to your computer and use it in GitHub Desktop.
Example of how to use SubdomainRoute class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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