Skip to content

Instantly share code, notes, and snippets.

@vkoppaka
Created May 24, 2012 05:48
Show Gist options
  • Select an option

  • Save vkoppaka/2779700 to your computer and use it in GitHub Desktop.

Select an option

Save vkoppaka/2779700 to your computer and use it in GitHub Desktop.
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//General Route
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
new string[] { "AmbiguousControllers.Controllers" }
);
//Route for Admin Area
routes.MapRoute(
"Admin Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { area = "Admin", controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
new string[] { "AmbiguousControllers.Areas.Admin.Controllers" }
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment