SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    asp - mailto and http: links from dynamic pages

    hi,
    trying to work out why i cannot activate the mailto: and http:www. links when i populate an html from data on a SQL database. For example:

    <a href="mailto%=myemailfield%>"><%=myemailfield%></a>

    and also:

    <a href="http://<%=myweburlfield%>"><%=myweburlfield%></a>


    very puzzling, can anyone help?
    cheers
    adam


  2. #2
    SitePoint Wizard big_al's Avatar
    Join Date
    May 2000
    Location
    Victoria, Australia
    Posts
    1,661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks fine to me, what is the outcome when you do this?
    .NET Code Monkey

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,
    the outcome is that when the place my mouse over the cursor it seems to not respond as if a hyperlink is present.
    i.e. no hand appears and i am unable to click it!!

    very strange.

    very much appreciate any ideas...

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,
    unable to click the text as a hyperlink, just looks like normal static text on the page.

    very weird.

    any ideas?

  5. #5
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you defining those variables somewhere?

    Code:
    <%
    Dim myemailfield
    myemailfield = Request.Form("somefield")
    %>
    
    <a href="mailto:<%=myemailfield%>"><%=myemailfield%></a>
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  6. #6
    SitePoint Member tscratch's Avatar
    Join Date
    May 2001
    Location
    Florida
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually right it all out with Response.Write like this.

    Response.Write "<tr><td class=xlink><a href=http://" & objRS("siteURL") & " target=_blank>" & objRS("siteName") & "</a></td></tr><tr><td class=desc>" & objRS("siteDesc") & "</td></tr>"

    Looking at it now i see that it does not produce code that is completely valid. You would need to add quotes around a few things to achieve this such as

    "<tr><td class=" & Chr(34) & "xlink" & Chr(34) & "><a href=" & Chr(34) & "blah blah blah"

    Hope this helps. it may take a little more typing, but it always works for me.
    --
    Eric

  7. #7
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by tscratch
    "<tr><td class=" & Chr(34) & "xlink" & Chr(34) & "><a href=" & Chr(34) & "blah blah blah"
    Or you could do something like this.

    Code:
    "<tr><td class=""xlink""><a href=""http://" & yourURLVar & """>"
    Double double quotes in a text string will give a single double quotes in the HTML output (hope that made sense).

    addstravel look at the source of your output HTML and try to figure out what's wrong from there.
    Last edited by duckie; Jun 17, 2001 at 03:34.

  8. #8
    SitePoint Member tscratch's Avatar
    Join Date
    May 2001
    Location
    Florida
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks Duckie!

    I, like many others here, am just learning ASP. Sometimes while trying to fry the big fish I don't pick up on the little ones. You have just saved me an infinite amount of future time!
    --
    Eric

  9. #9
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about if you show us more/all of the code? It's most likely an error somewhere else, or with quotes, variables, or something of the like.

    'Till next time..
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  10. #10
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,615
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you View Source..what does the code look like?

  11. #11
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,294
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)

    Re: asp - mailto and http: links from dynamic pages

    The problem may very well be in the saving of the data. When you save the data to the database, you may need to use this:

    Server.URLEncode(myweburlfield)

    Here is how I would code the output.
    Response.Write "<a href=""mailto:" & myemailfield & """>" & myemailfield & "</a>
    Response.Write "<a href=""http://" & myweburlfield & """>" & myweburlfield & "</a>
    Last edited by DaveMaxwell; Jun 19, 2001 at 11:45.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse


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
  •