|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
This code snippet creates an iframe and creates 5 links above it to display .jpg images. the file path is pulled from an access db.
The problem is this code works perfectly and opens the images correctly in the iframe "picturesframe" but only on my development pc. when i upload the web pages to my live server the when clicking the links nothing appears to happen and the images will not display. I have been unsuccesssful in figuring this out. Even if I hard code the path ie "c:\images\picture.jpg" it will not open in its frame. Both the developement server and live server are both running iis 5.1. Please help me I am going crazy! I have inluded the entire .asp file but have uploaded as .txt it looks a little ugly in .txt format please see profile.txt Code:
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr >
<td>
<table border="1" cellpadding="0" cellspacing="0" summary="">
<tr>
<td width=70>
<center>
<a href=<%=rs("Picture1")%> target="picturesframe">Photo 1</a>
</center>
</td>
<td width=70>
<center>
<a href=<%=rs("Picture2")%> target="picturesframe">Photo 2</a>
</center>
</td>
<td width=70>
<center>
<a href=<%=rs("Picture3")%> target="picturesframe">Photo 3</a>
</center>
</td>
<td width=70>
<center>
<a href=<%=rs("Picture4")%> target="picturesframe">Photo 4</a>
</center>
</td>
<td width=70>
<center>
<a href=<%=rs("Picture5")%> target="picturesframe">Photo 5</a>
</center>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr>
<td width="450" height="300">
<center>
<iframe scrolling="no" border="0" frameborder="0" height="300" width="450" align="center" name="picturesframe" src=<%=rs("Picture1")%>></iframe>
</center>
</td>
</tr>
</table>
|
|
#2
|
||||
|
||||
|
Relative paths
You will need to specify a relative path to the image files. The c:/... path is only good for your PC, unless of course the host PC is set up exactly the same as yours and you want to allow anonymous access to the C: drive
Change the links to something like: Code:
a href=<%=Server.Mappath(rs("Picture1"))%>
and then change the content of the rs fields so that they hold just the filename (somepicture.jpg) and if required the folder path (images/somepicture.jpg).
__________________
-
thought-after | my thoughts on web development Get Firefox, the developers browser Budget hosting - recommended [/left] |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Link problem with .jpg |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|