problem: querystring and '&'

  • Thread starter Thread starter Stanley
  • Start date Start date
Hi all,
I am trying to read a parameter value that contains special characters
such as '&' using Request.Querystring. But it does not read the whole string
containing the value. How can I allow the link to pass parameter with
special characters?

Thanks...
-Nikhil
 
Thanks.
I tried your solution. But it did not work. Probably because the
application that opens my ASP.Net page does not support ASP.Net. It needs to
be in HTML/Javascript/VBScript. Please help.

-Nikhil
 
Are you hardcoding this link in a static .htm page then? If so:

<a href="page.aspx?q=a%26b">click me</a>

%26 is the urlencoded & character.

Or, in client side javascript:

<script type="text/javascript">
function goSomewhere() {
var sQString='a&b';
var sHref = 'page.aspx?q=' + escape(sQString);
location.href=sHref;
}
</script>

<button onclick="goSomewhere();">click me</button>

Ray at home
 
server.UrlDecode



-Stanley



Nikhil Patel said:
Hi,
escape function worked for me. Thank you very much. May I ask one more
question. Do I need to use any decoding function in ASPX page to receive the
value?

Thanks...
-Nikhil
 
Hi,
escape function worked for me. Thank you very much. May I ask one more
question. Do I need to use any decoding function in ASPX page to receive the
value?

Thanks...
-Nikhil
 
Back
Top