Forums

ASP

This topic is locked

Hyperlink from Access field - beginner question!

Posted 12 Jun 2006 07:22:27
1
has voted
12 Jun 2006 07:22:27 John Marsden posted:
How do I create a hyperlink from an Access database field? The code shows the URL but not linked. I've tried inserting the anchor tag (HTML) within the ASP but I can't get the syntax right.
Also, I would like to get the field labels (Email and Website) to appear only when there is a corresponding URL. Again I've tried various cominations of Response.Write to no avail.
<pre id=code><font face=courier size=2 id=code> &lt;td width="242" align="left" valign="top"&gt;Email: &lt;%=(rsOrgs.Fields.Item("orgEmail".Value)%&gt;&lt;/td&gt;
&lt;td width="359" align="left" valign="top"&gt;Website: &lt;%=(rsOrgs.Fields.Item("orgWebsite".Value)%&gt;&lt;/td&gt;</font id=code></pre id=code>

Replies

Replied 12 Jun 2006 11:53:05
12 Jun 2006 11:53:05 soul here replied:
try..
&lt;A HREF="www.yahoo.com"&gt;&lt;%= rsOrgs.Fields.Item("orgEmail".Value %&gt;&lt;/A&gt;

hope it can help...
Replied 13 Jun 2006 03:18:07
13 Jun 2006 03:18:07 John Marsden replied:
I need for the anchor to point to the address contained in the orgMail field. To do this I think I need the A HREF to be contained in the ASP code but am stuck as to how the syntax works.

Thanks
Replied 11 Jul 2006 17:19:38
11 Jul 2006 17:19:38 Wayne Hultum replied:
<pre id=code><font face=courier size=2 id=code>
a href="mailto:&lt;%=(rsOrgs.Fields.Item("orgEmail".Value)%&gt;"

a href="&lt;%=(rsOrgs.Fields.Item("orgWebsite".Value)%&gt;" if you have the full url in the database
or
a href="&lt;%=(rsOrgs.Fields.Item("orgWebsite".Value)%&gt;" if you just have the www. in the database
</font id=code></pre id=code>
hope this helps

Edited by - wayne1000 on 11 Jul 2006 17:20:20

Reply to this topic