I’m sure this has been asked time and time again. And yes I’ve searched. However, I’m unable to find an example that clearly demonstrates what I’m looking to accomplish.
I’m currently on mywebsite/test.aspx, I want to Redirect to mywebsite/testing.aspx. However I want this redirect to work both live on server and within debug of visual studio. I’ve tried
Response.Redirect(Request.RawUrl.Replace(Request.RawUrl,"testing.aspx"))
However this replaces the whole thing.
Hope this makes sense – mywebsite/test.aspx should redirect to mywebsite/testing.aspx
Use application relative urls.
~/represents the application root path, so it will work for both/and/virtual-directory/.