I am using URL Routing in my .Net Web Application. I would like to prevent users from being able to access the .aspx page.
Example:
Actual URL - http://www.mysite.com/Testimonials.aspx
Routed URL - http://www.mysite.com/Testimonials
I want users to be able to access the page only by going to /Testimonials
, but I would like to setup /Testimonials.aspx
to redirect to its route at /Testimonials
.
Is there an easy way to do this for Routed Pages throughout the application?
You can handle the redirect by checking the URL in the Load Event. Check this http://msdn.microsoft.com/en-us/library/cc668201.aspx#adding_routes_to_a_web_forms_application for routing the /Testimonials to the page you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With