views:

891

answers:

3
+1  Q: 

anchor IE 6 bug

I created an anchor like this:

<a id="create" />

and it works in IE 7 but not in IE 6.

How do I fix it in IE6?

Further Info:

I am using asp.net c#. I am running it in IE6 and in an iframe. The screen just refreshes and the panel doesn't show. But if I don't use:

Response.Redirect(Request.Url.PathAndQuery + "&New=1#create");

i.e. If I do:

Response.Redirect(Request.Url.PathAndQuery + "&New=1");

It works fine, but doesn't goto the panel. btw: it all works fine under IE 7. It doesnt work in IE 6 or in IE 6 in an iframe

+2  A: 

from memory you use the 'name' attribute

SpliFF
sorry that doesn't work either, I may have forgotten to add but the webpage I am running is in an iframe. I am unsure how this would affect it.
waqasahmed
+1  A: 

try to use name='create'

x4tje
sorry that doesn't work either, I may have forgotten to add but the webpage I am running is in an iframe. I am unsure how this would affect it.
waqasahmed
is the originating link in the iframe as well?
SpliFF
When I do it on IE 7, it is not in an iframe. It works fine.In IE 6, it doesn't work at all. Whether in iframe or not.
waqasahmed
+3  A: 

IE 6 has a strange behaviour, it does not recognizes redirects with anchors in it. The workaround is to add additional ampersand symbol '&' before the '#'. So, in your example, the code will look like Response.Redirect(Request.Url.PathAndQuery + "&New=1&#create");

I suggest you to check User-Agent on the server side and add this additional ampersand if the browser is IE 6.

Artem K.
Check this post for more information http://blogs.vertigo.com/personal/tomphan/Blog/Lists/Posts/Post.aspx?ID=6
Artem K.
You're kidding?! Of all gay IE6 behaviour I think this rates as one of the gayest!
SpliFF
Thanks very much... this solved it... can't believe IE6 has this bug. But since all my end-users are using IE6, it was mandatory.Thanks again!
waqasahmed