HTML: <a href="?qencl=<%=qencl%>&cat=<%=qc%> ....
ASP: Response.Write "<a href=?qencl="&qencl&"&cat="&qc&"...
the queried object "cat" does not break up if the "cat" has spaces in
it on the "HTML" version
the queried object "cat" breaks off at the first space in the "ASP:
version
HTML = http://www.mysite.com/my.asp?qencl=sup&cat=Critical
Infrastructure and Key Resources
ASP: = http://www.mysite.com/my.asp?qencl=sup&cat=Critical
not sure to what extent i need to use Server.URLEncode in this snafu
???
NS
dim q, r, t
q = 1
r = 2
t = 3
Response.Write "<a href=" & chr(34) & "somepage.asp?q=" & id &
"&r=" & col & "&t=" & tld & chr(34) & ">somepage</a>"
which the browser will parse as
<a href="somepage.asp?q=1&r=2&t=3">somepage</a>
The & character should be escaped & except in the case of a
response.redirect or server.transfer, and the quotation marks should
remain in place. Others use double quotes, but I prefer using chr(34)
instead - it's easier to debug.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
In the latter case you are not quoting the URL, which is why a space causes
a problem. You should never be using spaces in URLs though.
In both case, use Server.URLEncode to encode each value, eg.
Response.Write "<a href=""?qencl=" & Server.URLEncode(qencl) & "&cat=" &
Server.URLEncode(qc) & ... """>"
note that I've also added "" after the href=, this is one way to add double
quotes into strings in ASP VBScript; another being the Chr(34) that Adrienne
has suggested.
--
Dan