GetRows() and hyperlinks

S

shank

<%
' Loop through the array holding the result set and display the data
For iCounter= varC1Begin to varC1End
Response.Write("<a href=prices.asp?manuf=" & arrResultSet(0,iCounter) & ">"
& arrResultSet(0,iCounter) & "</a><br>")
Next
%>

In the above Response.Write statement arrResultSet(0,iCounter) displays the
manufacturer just like it should.

However, within the hyperlink, if a manufacturer has 2,3, or more words, it
will only show the first word. Anything after the first space is ignored.
Why?

thanks!
 
D

Daniel Crichton

shank wrote on Mon, 17 Mar 2008 12:36:57 -0400:
<%
' Loop through the array holding the result set and display the data
For iCounter= varC1Begin to varC1End
Response.Write("<a href=prices.asp?manuf=" & arrResultSet(0,iCounter) &
">" & arrResultSet(0,iCounter) & "</a><br>")
Next %>
In the above Response.Write statement arrResultSet(0,iCounter) displays
the manufacturer just like it should.
However, within the hyperlink, if a manufacturer has 2,3, or more
words, it will only show the first word. Anything after the first
space is ignored. Why?

Because spaces aren't allowed in URLs. There is a simple fix using
Server.URLEncode

Response.Write("<a href=prices.asp?manuf=" &
Server.URLEncode(arrResultSet(0,iCounter)) & ">"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top