From: .Net Sports on 24 Dec 2009 14:11 I have querystrings that are referencing the same queried object: 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
From: Dan on 30 Dec 2009 04:38 ".Net Sports" <ballz2wall(a)cox.net> wrote in message news:46fdbede-f1a6-4711-952f-87c689fbf5af(a)h14g2000pri.googlegroups.com... > I have querystrings that are referencing the same queried object: > > 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 > 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
|
Pages: 1 Prev: Type mismatch problems with select box list Next: Economical Auction Site |