ASP.NET - Server.Transfer with url in browser updated

329 Views Asked by At

I am not sure if I will be able to explain this clearly.

I have a page on the website, lets say www.example.com/mypage/

Due to some business reason I would like to redirect the user to another page in the same website, say www.example.com/myotherpage/ as soon as the user enters www.example.com/mypage/ on the browser and hits go (I mean there is no referred url from which I can maintain any state).

Response.Redirect works just fine but due to the round trips it takes one hell of a time to load.

If I use Server.Transfer the loading time reduces significantly (less than half the time taken for Response.Redirect) but the url remains as it is i.e. www.example.com/mypage/.

My client would like to see the url of the new page in the browser i.e. www.example.com/myotherpage/.

On googling a little I found window.history.pushState (given here) but this is only applicable to latest browsers.

Also I need this on a mobile device so not sure if this code will work there.

I tried to search on the internet of any better ideas but not able to find one.

Any ideas will be of great help.

Thanks in advance!

0

There are 0 best solutions below