Click to See Complete Forum and Search --> : How to find my image if img src is xml


Lilib
09-06-2008, 04:04 PM
In this code I can go to next, last first, previous image but I cannot begin my navigation from the image that I got as asp argument, I couldn't set my xmlDoc to this image. Is it wrong syntax?
This line works :
<%
dim imgFile
imgFile=Request.QueryString("ImgName")
Response.Write("Your image name is " & imgFile & "!<br />")
%>
This one -not
<xml id="xmlDoc" src="BGForHtm2.xml"></xml>
xmlDoc.recordset.FindFirst "<%=imgFile%>"

Navigation begins from the first img
Here is all code:

<html>

<head>
<script language=vbscript>
Sub movePrev()
On Error Resume Next
xmlDoc.recordset.movePrevious()
If xmlDoc.Recordset.BOF = True Then
xmlDoc.recordset.moveFirst()
End If
End Sub
Sub moveNext()
On Error Resume Next
xmlDoc.recordset.moveNext()
If xmlDoc.Recordset.EOF = True Then
xmlDoc.recordset.moveLast()
End If
End Sub
</script>
</head>

<body bgcolor=maroon>
<%

dim imgFile
imgFile=Request.QueryString("ImgName")
Response.Write("Your image name is " & imgFile & "!<br />")
%>

<xml id="xmlDoc" src="BGForHtm2.xml"></xml>
xmlDoc.recordset.FindFirst "<%=imgFile%>"
<center>

<table datasrc="#xmlDoc" datafld="OneCell"
align="left" height="100%" width="100%" >
<tr height="2%">
<td align="left" width="45%">
<INPUT TYPE=BUTTON VALUE="First" onclick="xmlDoc.recordset.moveFirst()">
<INPUT TYPE=BUTTON VALUE="Next" onclick="moveNext">
<INPUT TYPE=BUTTON VALUE="Previous" onclick="movePrev">
<INPUT TYPE=BUTTON VALUE="Last" onclick="xmlDoc.recordset.moveLast()">
<INPUT TYPE=BUTTON VALUE="All Pictures" onclick="document.location='BG.xml'">
</td>
<td align="left" >
<font color="white"> <span datasrc="#xmlDoc" datafld="tata"> </span> </font>
</td>
</tr>
<tr>
<td colspan="2">
<center>
<img datasrc="#xmlDoc" datafld="ImgName" border="0" width="960" height="720"></img>
</center>
</td>
</tr>
</table>
</center>
</body>
</html>