If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Image Source problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 11:54
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Image Source problem

The 3 lines of code below, do not produce an error, but, the variable image does not show.

1. Yes my browser is set to show pictures
2. I check the properties of the image box with the little red "X" in the corner, and it showed the complete path, but NOT the image file itself, which is represented below by the fields.item variable.
3. Yes, the fields.item statement has the correct value in it I checked, and because the link works.

What have I done wrong?

<td align="left"> <a href="<%response.write"images/"&(rs.Fields.Item("picturefile"))%>">

<img src="images/"<%rs.Fields.Item("picturefile")%> alt="" name="Thumb" width="80" height="80" border="1">

</a></td>

Thanks for any help.
Reply With Quote
  #2 (permalink)  
Old 02-05-04, 16:23
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Is "picturefile" a string representing the file name, or a BLOB which contains the actual image itself?

If it's just the file name of the picture, try this:

<img src="images/<%=rs.Fields.Item("picturefile")%>" alt="" name="Thumb" width="80" height="80" border="1">


The only change I made, was to add "=" after the <%, and move the "double quote" from before <% to after %>

The purpose of the "=" is that it acts as a Response.Write and will write the value of "picturefile" to the HTML. Secondly, the double quote before the <% needed to be moved to after the %> since you want the file name to be included in the SRC attribute. Previously, only the value "images/" was being picked up...

Hope that helps!
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 02-05-04, 17:12
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
It helped!

All done.

Thanks a ton!

After about 90 mins of playing with it (and becoming frustrated beyond belief), it ensures that I won't soon forget it for next time...

Thanks again.
Reply With Quote
  #4 (permalink)  
Old 02-05-04, 19:06
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
<%= Request("fieldName") %>

=

<% Response.Write Request("fieldName") %>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On