I’m reading about URL routing at How to: Define Routes for Web Forms Applications and there’s something in the example I don’t understand. If you look at the example provided below,
routes.MapPageRoute("", "SalesReport/{locale}/{year}/{*queryvalues}", "~/sales.aspx");
specifically at
"SalesReport/{locale}/{year}/{*queryvalues}"
Why does queryvalues have an asterisk in front of it and locale and year don’t?
The * indicates a “catch all” parameter, which essentially matches everything else in the requested URL.
Everything after the “year” parameter in the URL will get dumped into the queryvalues parameter. So for example, the URL
will give you a queryvalues variable populated with
"x=1". But it will also match the URLand queryvalues will be populated with
"x=1/y=2/z=3".You can only have one catch-all parameter in your route, and it has to be the final parameter.