Hi - how is Server.URLEncode supposed to work?
If I write:
<a href="http://www.somesite.com?SomePage.asp?<%=Server.URLEncode("PageFrom=ProductPage&CoGUID=D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D")%>">Go somewhere</a>
The receiving page cannot extract the CoGuid from the QueryString.
If I write:
<a href="http://www.somesite.com?SomePage.asp?PageFrom=ProductPage&CoGUID=<%=Server.URLEncode("D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D")%>">Go somewhere</a>
... the CoGuid can be retrieved.
But I thought Server.URLEncode could be used to encode the whole string?
strURL = "http://www.somesite.com?SomePage.asp?PageFrom=ProductPage&CoGUID=D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D"
<a href="<%=Server.URLEncode(strURL)%>">Go somewhere</a>
But when you mouse over the link it has put the web address of the site I am on in front of the url. So if the page is on www.mysite.com the link then looks like ...
So what am I doing wrong? Can you encode a whole string with Server.URLEncode and, if you can, how do you stop it prefixing the string with the URL of the site the page is on?
Why can't I encode the bit after the ? in the URL. If I do this the CoGUID is not retrieved from the querystring.
What am I doing wrong? Thanks for any help.