Results 1 to 6 of 6

Thread: Links with ASP

  1. #1

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38
    Hi.. how could i link an ASP script to its own domin
    for example:
    newyork to www.newyork.com
    miami to www.miami.com
    ...

    I tried this:

    <a href="http://www." & <%=rsInfo("city")%> & ".com"><%=rsInfo("city")%></a>


    ...but it shows me "http://www."

    how can I string these????????
    betto

    PD: thanks Sonia

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Try This

    I am new to ASP too. I THINK this might work but am not sure.
    Code:
    <%
    Dim CityLink
    
    CityLink = "http://www." & rsInfo("city") & ".com"
    %>
    
    <a href="<%CityLink%>"><%=rsInfo("city")%></a>

  3. #3

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38
    Great Drew!!!!!!!!!
    ...but just a little thing.. in

    <a href="<%CityLink%>"><%=rsInfo("city")%></a>

    it must be:

    <a href="<=%CityLink%>"><%=rsInfo("city")%></a>

    you forgot "="
    THANKS!!!!!!!!!!!!!!!!!

    betto

  4. #4

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38
    ...well or

    <%=CityLink%>

    whatever
    betto

  5. #5
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    Yep, forgot the equal mark. Hope that worked for you!

  6. #6
    Guest

    Just do this:

    <a href="http://www<%=rsInfo("city")%> .com"><%=rsInfo("city")%></a>

    you don't need the double quotes since you technically aren't building a string variable.

    If you were using response.write to print the html, then you would need the double quotes(without <%=):

    response.write "<a href=""http://www." & rsInfo("city") & ".com"">" & rsInfo("city") & "</a>"

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