I’m writing a web service which expects one of the parameters (called “hlink”) to be a url. Before calling the web service I URLEncode the parameter in question (“hlink”). I then call the web service with an hlink parameter value of 'a.apsx?a=1&b=2. When the request arrives at the web service method I can examine hlink – it has received the url ok, but only as "a.aspx?a=1" – i.e. it has lost the &b=2 part of the parameter. This seems to be asp.net stripping off the &b=2 bit – how can I get the whole parm value passed into my web method?
Thanks very much!
Are you absolutely certain that you are urlencoding the value before placing it in the query string? The query string parser splits on the ‘&’ sign, which should be %26 after it is url encoded. If it remains as an ‘&’ character, it will cause the query string parser to b=2 is another name value pair in the outer query string. I’d take a closer look at what you are sending.
You should see something like this: hlink=a.apsx%3Fa%3D1%26b%3D2