Skip to content

Instantly share code, notes, and snippets.

@ondravondra
Created November 12, 2013 14:09
Show Gist options
  • Save ondravondra/7431416 to your computer and use it in GitHub Desktop.
Save ondravondra/7431416 to your computer and use it in GitHub Desktop.
asp.net route for index with integer id parameter
routes.MapRoute(
name: "IndexWithId",
url: "{controller}/{id}",
defaults: new { action = "Index" },
constraints: new RouteValueDictionary { { "id", "[0-9]+" } }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment