Skip to content

Instantly share code, notes, and snippets.

@azcoov
Created January 23, 2011 02:26
Show Gist options
  • Save azcoov/791747 to your computer and use it in GitHub Desktop.
Save azcoov/791747 to your computer and use it in GitHub Desktop.
routes for my blog
routes.MapRoute(
"BlogPost",
"Entries",
new { controller = "Blog", action = "BlogPost"}
); // outputs: mysite.com/Entries?id=0
routes.MapRoute(
"BlogPost1",
"Entries/{id}",
new { controller = "Blog", action = "BlogPost" }
); // outputs: mysite.com/Entries/0
routes.MapRoute(
"BlogPost2",
"Entries/{year}/{month}/{day}/{title}",
new { controller = "Blog", action = "BlogPost" }
); // outputs: mysite.com/Entries/2010/01/14/Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment