...

View Full Version : How do I display a hyperlink when showing database search results? (ASP)



waarbs
05-04-2006, 01:10 PM
In my site we have a search form that displays records from a database. One of the fields contains web links, which I would like to display as html web links in the asp results page. I am not sure how to get this to work. Any ideas anyone?

The search results page can be found at http://www.munzamedia.co.uk/trip/courseSearch.asp?level=PhD&university=Derby&Submit=Find+a+course

My code to display the result as a link, currently looks like this:

<tr>
<td><strong>Web Link : </strong>
<a href = "
<%
Response.Write(RSCustomerList("website"))
%>
">Link</a>
</a>
<hr align="left" noshade width = "400" color = "#FD5583">
</td>
</tr>

ronaldb66
05-04-2006, 01:20 PM
I don't understand what you're after: by what I'm seeing, you are displaying a HTML link. Or do you mean to alter the "link" text?

vinyl-junkie
05-04-2006, 01:20 PM
Aside from the fact that you have an extra </a> closing tag, your code looks fine.

BTW, when including code in your posts, you need to enclose your code in the code tags (the # icon in the reply window). :)

waarbs
05-04-2006, 01:31 PM
I don't understand what you're after: by what I'm seeing, you are displaying a HTML link. Or do you mean to alter the "link" text?

If you try and click the link, it does nothing. If you hover the mouse over the word that says 'link', the string is incorrect, it should be http://www.derby.ac.uk/C3_pg.asp?Id=287&SubjectID=46


Thanks for getting back to me quickly.
M

waarbs
05-04-2006, 01:54 PM
I actually fixed this problem by changing the links in the database from hyperlink type fields to memo fields, which added the unnecessary #s.

On another forum someone suggested a good workaround using the replace function:



<tr>
<td><strong>Web Link : </strong>
<a href = "<%=Replace(RSCustomerList("website"),'#','')%>">Link</a>
<hr align="left" noshade width = "400" color = "#FD5583">
</td>
</tr>


Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum