Created
November 12, 2013 14:09
-
-
Save ondravondra/7431416 to your computer and use it in GitHub Desktop.
asp.net route for index with integer id parameter
This file contains hidden or 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
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