Response.Redirect with a fragment identifier causes unexpected refresh when later using location.has
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2009-12-31T11:30:40Z
Indexed on
2010/03/11
5:08 UTC
Read the original article
Hit count: 655
Hi All,
I was hoping someone can assist in describing a workaround solution to the following issue I am running into on my ASP.NET website on IE. In the following I will describe the bug and clarify the requirements of the needed solution.
Repro Steps:
- User visits A.aspx
- A.aspx uses Response.Redirect to bring the user to B.aspx#house
- On B.aspx#house, the user clicks a button that sets window.location.hash='test'
Actual Results:
B.aspx is loaded again. The URL now shows B.aspx#test
Expected Results:
No reload. The URL will just change to B.aspx#test
Requirements:
- Page A must redirect to page B with a fragment identifier in the url
- Any user action on page B will set the location.hash
- Setting location.hash must not make page B refresh
- This must work on IE
Notes:
- Bug only repros on IE (tested on ie6|7|8). Opera, FF, Chrome, Safari all have the expected results of no reload.
- This error may have nothing to do with ASP.NET, and everything to do with IE
- For any kind soul willing to have a look at this, I have created a minimal ASP.NET web project to make it easy to repro here
© Stack Overflow or respective owner