SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Spaces in Hyperlink URL problem

    If hyperlinks to a URL contains spaces, the entire hyperlink is not underlined in an email message.

    I've tried using "<" and ">" on both ends of the URL variable, double quotes, single quotes, Server.URLEncode method, and nothing works. Code I've tried is below, plus more. Anyone have an idea how to get the entire URL to be shown as a hyperlink in the email?

    msg = msg & "Driving Directions: " & Session("DrivingDirections")

    msg = msg & "<" & "Driving Directions: " & Session("DrivingDirections") & ">"

    msg = msg & """ & "Driving Directions: " & Session("DrivingDirections") & """"

    NOTE: Using Server.URLENcode is really strange...no link either
    'msg = msg & ("Driving Directions: " & Server.URLEncode(Session("DrivingDirections")))

    '

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you could put an inline style around the url text.

    e.g.
    <span class="text-decoration:underline;">url........</span>

  3. #3
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If a link is not fully underlined then it is not being treated as a full link. So applying text-decoration just masks the issue, it doesn't solve it.

    Can you give as some example data as to what Session("DrivingDirections") contains? One option may be to apply Session("DrivingDirections") to a local variable, then Replace() any spaces with %20 and use the local variable in the msg.
    Ian Anderson
    www.siteguru.co.uk

  4. #4
    SitePoint Member
    Join Date
    May 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's exactly what I did, use the replace and that worked.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •