SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    phpLD Fanatic bronze trophy dvduval's Avatar
    Join Date
    Mar 2002
    Location
    Silicon Valley
    Posts
    3,626
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Displaying Hyperlink using Response.Write

    I'm somewhat of a beginner and hope to get a little help. Let me explain:
    I have 2 variables:
    1) LinkText is a the text for the link
    2) LinkUrl is the full path of the link
    All I want to do is get the link to appear on the page. I have been crashing and burning on response.write statements. I'm a little confused about all the quotes. Or if there is a better method besides response.write, I'm all ears.

    Note: It took me 2 minutes to figure out how to do this in PHP, but for some reason, I'm running into problems in ASP. I would assume this should be super easy.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    <%
    Function writeLink (path, text)
    'builds an <a> tag (link) with filepath and text arguments
      writeLink = "<a href=""" & path & """>" & text & "</a>"
    End Function
    %>
    
    <%
    'example of use
    Response.Write(writeLink(LinkText, LinkUrl))
    %>


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
  •