Hyperlinking in a returned recordset

M

Micromanaged

I have a customers table in my database (SQL 2k) with a column called
[E-mail]. What I would like to set up (if possible) is to have the ASP
page, as it returns the requested recordset, if it has an email address
to display the email address as a hyperlink (i.e. mailto:
(e-mail address removed)) while showing the email address so the end users
can just click on the email address field and have it pull up a new mail
message with the To: address filled in.

Thoughts?

Thanks in advance.
 
R

Ray Costanzo [MVP]

If it were just static HTML, what would you do? <a
href="mailto:p[email protected]">[email protected]</a>, right? Well, part of
the function of ASP is to return HTML, so just have it return HTML like that
by just substituting the hard-coded e-mail address for a variable that
represents it. For example:

<%
sEmail = yourRecordset.Fields.Item(0).Value
%>
<a href="mailto:<%=sEmail%>"><%=sEmail%></a>

Ray at work
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top