GetRows() and hyperlinks

Discussion in 'ASP General' started by shank, Mar 17, 2008.

  1. shank

    shank Guest

    <%
    ' 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!
    shank, Mar 17, 2008
    #1
    1. Advertising

  2. 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
    Daniel Crichton, Mar 17, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Croney69

    Using GetRows()

    Croney69, Jul 28, 2003, in forum: ASP General
    Replies:
    5
    Views:
    163
    Bob Barrows
    Jul 28, 2003
  2. Moshe

    GetRows Mystery

    Moshe, Aug 28, 2003, in forum: ASP General
    Replies:
    8
    Views:
    123
    Bob Barrows
    Aug 28, 2003
  3. Crane Linkledder

    Difference between getrows and getstring

    Crane Linkledder, Oct 29, 2003, in forum: ASP General
    Replies:
    11
    Views:
    253
    Aaron Bertrand - MVP
    Oct 30, 2003
  4. Jim

    GetRows Random <td></td> Output

    Jim, Nov 21, 2003, in forum: ASP General
    Replies:
    1
    Views:
    107
    Jeff Clark
    Nov 22, 2003
  5. Harag

    JScript & GetRows

    Harag, Dec 27, 2003, in forum: ASP General
    Replies:
    4
    Views:
    193
    The Mighty Chaffinch
    Dec 28, 2003
Loading...

Share This Page