Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > email to link

Reply
Thread Tools

email to link

 
 
Chas
Guest
Posts: n/a
 
      02-27-2004
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

 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      02-28-2004
How would you do it if you hard"coded" the HTML?

<td><a href="mailto"></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
>



 
Reply With Quote
 
 
 
 
Chas
Guest
Posts: n/a
 
      02-28-2004
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"></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
> >


 
Reply With Quote
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      02-28-2004
> <%
> 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/


 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-28-2004
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/
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get the email address of the person who clicked the link inthe email? Zeynel Python 1 12-06-2010 02:26 AM
Is D-Link DSL-604T same as D-Link DSL-604+ ? norm Wireless Networking 6 11-18-2005 10:25 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
D-LINK DWL-AG650 doesn't work with WinXP - Zero Configuration Service (WZCSVC) / D-Link AirXpert nearly works Johannes Rosenstock Wireless Networking 0 08-27-2004 11:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57