I have to map a nice looking ASP.NET MVC URL '/sel/F/61' to an ASPX url with query string parameters like 'familydrilldown.aspx?familyid=61'. I tried to add this to global.asax:
routeTable.MapPageRoute(
"selectorroute",
"sel/F/{familyid}",
"~/selector/familydrilldown.aspx");
which works, except that the familyid is not passed as a querystring to familydrilldown.aspx.
How can I take the {familyid} and pass it as a querystring parameter to the page familydrilldown.aspx?
I tried this:
routeTable.MapPageRoute(
"selectorroute",
"sel/F/{familyid}",
"~/selector/familydrilldown.aspx?familyid={familyid}");
but of course this doesn't really work...
Any ideas on how to do this?
Thanks!
I don't know if what you want is possible. Why don't you just use?
in the Page_Load (there might be some casting involved)
I found a solution by implementing my own IRouteHandler:
and registering it like: