David Glover
asked on
How do I avoid encoding when using asp:hyerlink and the navigateurl property?
I have a link in a database to a file on our network :
G:/Formatted CVs/FormattedCV_Ackerman_J _106485.do c
however when the link outputs to the browser it gets encoded to contain :
file:///G:/Formatted%2520C Vs/Formatt edCV_Acker man_J_1064 85.doc
The %2520 stops the link working in IE7. I can I prevent this encoding or should I use another control to output my hyperlink?
G:/Formatted CVs/FormattedCV_Ackerman_J
however when the link outputs to the browser it gets encoded to contain :
file:///G:/Formatted%2520C
The %2520 stops the link working in IE7. I can I prevent this encoding or should I use another control to output my hyperlink?
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#"file://" & Eval("ProformaLink").tostring %>' Target="_blank">
<asp:Literal ID="Literal2" runat="server" Text='Link'/>
</asp:HyperLink>
ASKER
Nope, sadly this generated the same link and the same problem.
Any other ideas?
Any other ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did the trick, I had a go at this before but wasn't able to get a syntax it was happy with, cheers!
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Server.UrlDecode(string.Fo
<asp:Literal ID="Literal2" runat="server" Text='Link'/>
</asp:HyperLink>