Results 1 to 5 of 5

Thread: Displaying Hyperlink - asp

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    5

    Question

    I have the following code which displays data from a mdb. There is a reference to a web address in the code and I would like to display this as a hyperlink on my asp page but don't know how too. Can any one help?
    <%
    dim RSc
    set RSc=server.CreateObject("adodb.recordset")
    RSc.open "Comp", "DSN=comp1"
    RSc.MoveFirst
    Response.Write "<TABLE ALIGN='CENTER' BORDER='0' cellspacing='2' width='700'>"
    Do while NOT RSc.EOF
    Response.Write "<TR><TD align='center' width='20%'><font face='verdana' size='1'>" & RSc("Product Name") & "</TD></font>"

    Response.Write "<TD align='center' width='20%'><font face='verdana' size='1'><a href='" & RSc("Web Site") & "'></a></TD></font>"

    Response.Write "<TD align='center' width='20%'><font face='verdana' size='1'>" & RSc("Type") & "</TD></font><TR>"
    RSc.MoveNext
    Loop
    Response.Write "</TABLE>"
    %>


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    What you've got looks pretty good you need the hyperlnk caption to be set as well though.


    Response.Write "<TD align='center' width='20%'><font face='verdana' size='1'><a href='" & RSc("Web Site") & "'>" & RSc("Web Site") & "</a></TD></font>"
    Mark
    -------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    5

    Unhappy Thanks for the reply

    Cheers for the prompt reply, but still no luck. No error is generated but no text or hyperlink is either. When there is no href in the code it produces #http://www.....# I don't know if that helps at all.

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    If you right click and View-Source is there any error message there?
    Mark
    -------------------

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    5

    Cool Done - cheers for helping

    It was still displaying # at the beginning and end of the link, changed the field type in mdb from hyperlink to text and it works. Thanks very much for your help Mark

Posting Permissions

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



Click Here to Expand Forum to Full Width