Redirection with ASP.Net friendly URLs

added by jalpesh
2/6/2013 1:42:10 PM


In this post we are going to see how we can use Response.Redirect(Redirecttion) in friendly URLs. Before some day I have written a post about ASP.NET Friendly URLs – Cleaner, SEO friendly URLs. On that post one reader called ‘Ramesh’ asked me that how we can do redirection with ASP.Net friendly URLs. So this post is in reply to Him. How to redirect a page to ASP.Net friendly URLs: Actually!! there is nothing to learn. It’s very easy You can directly use the ‘Response.Redirect’ with the ASP.Net friendly URLs. The NuGet Package itself takes care of all the things. You just need to write the route name as a parameter in ‘Response.Redirect’ and you are done!! Uh!! don’t believe me!!. Let’s take a sample example. I am going to use by default template with ASP.NET Friendly URLs. So for this example I have created a ASP.Net button in Default template AboutUs.aspx page. Once the click of that button we are going to use ‘Response.Redirect’ for redirection and redirect this page to Contact Page. Following is a html code for that button.