Home > Archive > ASP > March 2008 > GetRows() and hyperlinks
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
GetRows() and hyperlinks
|
|
|
| <%
' 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!
| |
| Daniel Crichton 2008-03-17, 6:57 pm |
| 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?
> thanks!
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)) & ">"
--
Dan
|
|
|
|
|