How do I redirect a route to another route in ASP.NET web forms?

I have routes like these:

routes.MapPageRoute("Survey", "Survey", "~/Survey/Survey.aspx")
routes.MapPageRoute("Letters", "About/Letters", "~/Pages/Letters/Letters.aspx")

How can I redirect a url like this: /Surveys to the 'Survey' route? So that when the user goes to /surveys it redirects to /Survey. (URLs for the sake of argument)

I'd prefer it if I didn't have to place redirect code in the ASPX file itself, and rather just have the code in the route rule, just keeps it simple and centralized.

Thanks

Luke

6
задан StrattonL 3 May 2011 в 22:56
поделиться