Hi - how is Server.URLEncode supposed to work?
If I write:
The receiving page cannot extract the CoGuid from the QueryString.
<a href="http://www.somesite.com?SomePage.asp?<%=Server.URLEncode("PageFrom=ProductPage&CoGUID=D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D")%>">Go somewhere</a>
If I write:
... the CoGuid can be retrieved.
<a href="http://www.somesite.com?SomePage.asp?PageFrom=ProductPage&CoGUID=<%=Server.URLEncode("D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D")%>">Go somewhere</a>
But I thought Server.URLEncode could be used to encode the whole string?
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 ...
strURL = "http://www.somesite.com?SomePage.asp?PageFrom=ProductPage&CoGUID=D4D47017-AA4D-47B6-8A8D-2D554F2AFD0D"
<a href="<%=Server.URLEncode(strURL)%>">Go somewhere</a>
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.