HyperLink control vs. Firefox

A

Arthur Dent

Hello all.... i am REally confused by something...

I have a hyperlink control on my page, and for the NavigateUrl property, i
have it set to "~/" in the property window (without the quotes).
Now, in IE this works beautifully, and the hyperlink redirects you to the
root of the web application.
In Firefox however it redirects you simply to the page you are currently on.
If you mouse over the link, the url that comes up in the status bar is the
exact url (including querystring) of whatever page you currently have
loaded.

I do not understand this at all. Isn't ~/ supposed to be resolved by the
control at runtime *on the server-side*?? So how does it come out different
in Firefox vs. IE?
Using ~/ in other controls and properties seems to work fine, (such as the
ImageUrl of the HyperLink and the Image controls). It is only in the
HyperLink.NavigateUrl property that i see this strange behaviour.

Ive seen this now on two different sites that weve done for two different
clients.

Can anyone explain this bizarre behaviour?
Thanks!

- Arthur Dent.
 
R

Ronny Ong

Arthur Dent said:
I do not understand this at all. Isn't ~/ supposed to be resolved by the
control at runtime *on the server-side*?? So how does it come out
different in Firefox vs. IE?
Ive seen this now on two different sites that weve done for two different
clients.

Did you try stripping everything out of your problematic pages to be sure
the fault was in the HyperLink control? It took me about 45 seconds to slap
together the following test page and prove that it works fine in Firefox
1.5.0.4. I would say that you've simply made the same mistake twice on your
two "different" sites.

<html>
<head><title>Test</title></head>
<body>
<asp:HyperLink
NavigateUrl="~/somewhere/something.htm"
runat="server"
Text="HyperLink Testt" />
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top