email to link

Discussion in 'ASP General' started by Chas, Feb 27, 2004.

  1. Chas

    Chas Guest

    I am using this code

    <table border="1">
    <%
    Do While Not rstSimple.EOF
    %>
    <tr>
    <td><%= rstSimple.Fields("username").Value %></td>
    <td><%= rstSimple.Fields("password").Value %></td>
    <td><%= rstSimple.Fields("email").Value %></td>
    </tr>
    <%
    rstSimple.MoveNext
    Loop
    %>
    </table>

    How can I make the email field a hyper link?

    Charlie
    Chas, Feb 27, 2004
    #1
    1. Advertising

  2. Chas

    Ray at Guest

    How would you do it if you hard"coded" the HTML?

    <td><a href="mailto:p"></a></td>

    Right? So, substitute the e-mail address for the variable (or recordset
    value) that represents the e-mail address. Let's put the value into a
    variable to make it simpler and a bit more efficient though.


    <%
    sEmail = rstSimple.Fields("email").Value
    %>

    <table border="1">
    <%
    Do While Not rstSimple.EOF
    %>
    <tr>
    <td><%= rstSimple.Fields("username").Value %></td>
    <td><%= rstSimple.Fields("password").Value %></td>
    <td><a href="mailto:<%=sEmail%>"><%=sEmail%></a></td>
    </tr>
    <%
    rstSimple.MoveNext
    Loop
    %>
    </table>


    Ray at home


    "Chas" <> wrote in message
    news:...
    > I am using this code
    >
    > <table border="1">
    > <%
    > Do While Not rstSimple.EOF
    > %>
    > <tr>
    > <td><%= rstSimple.Fields("username").Value %></td>
    > <td><%= rstSimple.Fields("password").Value %></td>
    > <td><%= rstSimple.Fields("email").Value %></td>
    > </tr>
    > <%
    > rstSimple.MoveNext
    > Loop
    > %>
    > </table>
    >
    > How can I make the email field a hyper link?
    >
    > Charlie
    >
    Ray at, Feb 28, 2004
    #2
    1. Advertising

  3. Chas

    Chas Guest

    Thanks so much this is great!
    Charlie

    "Ray at <%=sLocation%> [MVP]" wrote:

    > How would you do it if you hard"coded" the HTML?
    >
    > <td><a href="mailto:p"></a></td>
    >
    > Right? So, substitute the e-mail address for the variable (or recordset
    > value) that represents the e-mail address. Let's put the value into a
    > variable to make it simpler and a bit more efficient though.
    >
    > <%
    > sEmail = rstSimple.Fields("email").Value
    > %>
    >
    > <table border="1">
    > <%
    > Do While Not rstSimple.EOF
    > %>
    > <tr>
    > <td><%= rstSimple.Fields("username").Value %></td>
    > <td><%= rstSimple.Fields("password").Value %></td>
    > <td><a href="mailto:<%=sEmail%>"><%=sEmail%></a></td>
    > </tr>
    > <%
    > rstSimple.MoveNext
    > Loop
    > %>
    > </table>
    >
    > Ray at home
    >
    > "Chas" <> wrote in message
    > news:...
    > > I am using this code
    > >
    > > <table border="1">
    > > <%
    > > Do While Not rstSimple.EOF
    > > %>
    > > <tr>
    > > <td><%= rstSimple.Fields("username").Value %></td>
    > > <td><%= rstSimple.Fields("password").Value %></td>
    > > <td><%= rstSimple.Fields("email").Value %></td>
    > > </tr>
    > > <%
    > > rstSimple.MoveNext
    > > Loop
    > > %>
    > > </table>
    > >
    > > How can I make the email field a hyper link?
    > >
    > > Charlie
    > >
    Chas, Feb 28, 2004
    #3
  4. > <%
    > sEmail = rstSimple.Fields("email").Value
    > %>
    >
    > <table border="1">
    > <%
    > Do While Not rstSimple.EOF
    > %>


    Well, you probably want to assign the value inside the loop. ;-)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
    Aaron Bertrand [MVP], Feb 28, 2004
    #4
  5. Chas

    Ray at Guest

    Oh yeah. Good point. :]

    Ray at home

    "Aaron Bertrand [MVP]" <> wrote in message
    news:ex7l49h$...
    > > <%
    > > sEmail = rstSimple.Fields("email").Value
    > > %>
    > >
    > > <table border="1">
    > > <%
    > > Do While Not rstSimple.EOF
    > > %>

    >
    > Well, you probably want to assign the value inside the loop. ;-)
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    Ray at, Feb 28, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    783
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    434
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    406
  4. kolesdz
    Replies:
    9
    Views:
    515
    Blinky the Shark
    Aug 22, 2007
  5. Zeynel
    Replies:
    1
    Views:
    538
    alex23
    Dec 6, 2010
Loading...

Share This Page