Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code hyperlink problem 2

Status
Not open for further replies.

mazdaman

Programmer
Oct 17, 2003
55
GB
I want to make the "pic" the hyper link to detail.asp instead of the "name" - I cannot seem to get the syntax to work - can anybody help ....

Full Code ---------
<% CONST COL_COUNT = 2
If Not abc.EOF Then abc.MoveFirst
col_ctr = 0 'not really necessary
sec_row = ""

Response.Write "<table width=300 ><tr><th colspan=""" & COL_COUNT & """></th></tr>"
Do Until abc.EOF
If col_ctr mod COL_COUNT = 0 Then
Response.Write "<tr>"
sec_row = "<tr>"
third_row = "<tr>"

End If
Response.Write "<td width=145 cellpadding= 3 cellspacing=2 align=center class=imageframe ><IMG src='../upload/thumbs/"

If Trim(abc.Fields.Item("pic").Value) = ""
Then Response.Write "../upload/thumbs/image_1.jpg"
Else Response.Write abc.Fields.Item("pic").Value
End If

Response.Write "'></td>"
sec_row = sec_row & "<td cellpadding= 3 cellspacing=2 width=145 align=left valign=top ><a class=greendata target=frame href='detail.asp?name=" & abc("name") & "'>" & abc("name") & " </a></td>"
If col_ctr mod COL_COUNT = COL_COUNT - 1 Then
Response.Write "</tr>"
Response.Write sec_row & "</tr>"
Response.Write third_row & "</tr>"
Response.Write "<tr><td>&nbsp;</td></tr>" 'blank row could format this
End If

'used to be: col_cnt = col_cnt + 1
col_ctr = col_ctr + 1
abc.MoveNext
Loop
Response.Write "</table>"%>
 
try

Response.Write "<td width=145 cellpadding= 3 cellspacing=2 align=center class=imageframe ><a class=greendata target=frame href='detail.asp?name=" & abc("name") & "'><IMG src='../upload/thumbs/"

If Trim(abc.Fields.Item("pic").Value) = ""
Then Response.Write "../upload/thumbs/image_1.jpg"
Else Response.Write abc.Fields.Item("pic").Value
End If

Response.Write "'></a></td>"
sec_row = sec_row & "<td cellpadding= 3 cellspacing=2 width=145 align=left valign=top >& abc("name") & "</td>"
If col_ctr mod COL_COUNT = COL_COUNT - 1 Then
Response.Write "</tr>"
Response.Write sec_row & "</tr>"
Response.Write third_row & "</tr>"
Response.Write "<tr><td>&nbsp;</td></tr>" 'blank row could format this
End If

'used to be: col_cnt = col_cnt + 1
col_ctr = col_ctr + 1
abc.MoveNext
 
Thanks works great - just one other thing trying to put 'border=o' on the img scr tag, but im being a pratt. Im a noice, not sure how it fits. cheers
 
Something like this:

Response.Write "<td border=0 width=145 cellpadding= 3 cellspacing=2 align=center class=imageframe ><a class=greendata target=frame href='detail.asp?name=" & abc("name") & "'><IMG

----


-VJ
 
Thanks amorous - its not the cell, but the image itself. Because of the hyper link it defaults to a border around it. Im trying to get ride of this border around the hyper linked image Any ideas ?

I was trying to stick it somewhere here :
Response.Write "<td border=0 align=center width=145 class=imageframe ><a target=frame href='detail.asp?pic=" & abc("pic") & "'><IMG src='../upload/thumbs/"'border=0>"

this does not work ...
 
<IMG src='../upload/thumbs/' border=0>"

will do

Known is handfull, Unknown is worldfull
 
Thanks .Tired that vdkris, but doesnt work ! It just displays the image name and a palce holder where the image should be - the hyper link works.
 
thats because the image name is not given:
<IMG src='../upload/thumbs/IMAGENAME_HERE' border=0>"

that was just an example...

Known is handfull, Unknown is worldfull
 
The pic is pulled from the database - here is the full code

<% CONST COL_COUNT = 2
If Not abc.EOF Then abc.MoveFirst
col_ctr = 0 'not really necessary
sec_row = ""

Response.Write "<table width=300 align=centre ><tr><th colspan=""" & COL_COUNT & """></th></tr>"
Do Until abc.EOF
If col_ctr mod COL_COUNT = 0 Then
Response.Write "<tr>"
sec_row = "<tr>"
End If

Response.Write "<td align=center width=145 class=imageframe ><a target=frame href='detail.asp?pic=" & abc("pic") & "'><IMG src='../upload/thumbs/"
'VBKRIS this is where border=0 should go but can not get my head around the syntax

If Trim(abc.Fields.Item("pic").Value) = "" Then
Response.Write "../upload/thumbs/image_1.jpg"

Else Response.Write abc.Fields.Item("pic").Value
End If

Response.Write "'></td>"
sec_row = sec_row & "<td class=greendata >" & abc("name") & "</td>"
If col_ctr mod COL_COUNT = COL_COUNT - 1 Then
Response.Write "</tr>"
Response.Write sec_row & "</tr>"
Response.Write third_row & "</tr>"
Response.Write "<tr><td>&nbsp;</td></tr>" 'blank row could format this
End If

'used to be: col_cnt = col_cnt + 1
col_ctr = col_ctr + 1
abc.MoveNext
Loop
Response.Write "</table>"%>
 
Response.Write "<td align=center width=145 class=imageframe ><a target=frame href='detail.asp?pic=" & abc("pic") & "'><IMG border=0 src='../upload/thumbs/"

Known is handfull, Unknown is worldfull
 
WORKS GREAT ! Thank you very much. Excellent. I must get my head around all this. Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top