|
| |
|
|
evanesnard
Posts: 225 Joined: 4/10/2006 Status: offline
|
DB Value to Hyperlink - 6/20/2006 15:09:49
I need a little help fixing this DB Value to Hyperlink. I’m trying to display a hyperlink on one of my .asp pages from a value in one of my DB columns. What I need is to only generate and display a hyperlink if a value exists in the Upload_Doc1 DB column. I’m currently using the following code: </b><a href="http://www.mydomain.com/uploads/<%=FP_FieldURL(fp_rs,"Upload_Doc1")%>" style="text-decoration: none">View this document</font></font></td> This is working just fine…if a file name actually does exist in the DB column. The problem is if a file name does not exist in the DB column, a link is still created and displayed on the page and the link points to http://www.mydomain.com/uploads/ and of course the user then gets a message in their browser that says “Forbidden, You do not have permission to access this document.” I thought maybe http://www.mydomain.com/uploads/ could possibly be appended to the <%=FP_FieldURL(fp_rs,"Upload_Doc1")%> asp code, or rather to the value generated by that asp code, so that the http://www.mydomain.com/uploads/ does not even get written unless there’s a value in the DB column. Any help on this would be greatly appreciated. Thanks.
|
|
|
|
BeTheBall
Posts: 6385 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: DB Value to Hyperlink - 6/20/2006 16:10:58
You will need to do an If/Then analysis: <% If Trim(FP_FieldURL(fp_rs,"Upload_Doc1")) <>"" Then %> </b><a href="http://www.mydomain.com/uploads/<%=FP_FieldURL(fp_rs,"Upload_Doc1")%>" style="text-decoration: none">View this document</font></font></td> <% Else %> </b>No document available.</font></font></td> <% End If %>
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
evanesnard
Posts: 225 Joined: 4/10/2006 Status: offline
|
RE: DB Value to Hyperlink - 6/20/2006 16:24:10
Thanks Duane! That's exactly what I needed. Works perfect. Thanks again.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|