Using an ampersand in a string

Results 1 to 2 of 2

Thread: Using an ampersand in a string

  1. #1
    Mark West Guest

    Default Using an ampersand in a string

    When I pass a querystring value that contains an ampersand (&), the page reading that querystring truncates it at the embedded ampersand. e.g. <BR>?P=This & That <BR>truncates the string after &#039This &#039. It still happens when the value is enclosed in quotes. I can tell from the status bar of IE that the string is being SENT correctly, but VBScript at the receiving page still treats the ampersand as a terminator, and I only get the partial value. Any help would be greatly appreciated!

  2. #2
    Martin Wingert Guest

    Default RE: Using an ampersand in a string

    I solved the problem by replacing the & with @:<BR>string = Replace(string, "&","@")<BR>And switch back when received. <BR>string = Replace(string, "@","&")<BR><BR>You could also take a look at the URLEncode method in the Server-object:<BR>Server.URLEncode(string)<BR>/Good Luck<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts