Hi There,
I am working on images.I read the image files using File system objects and put them in the combo box to access. For this I'm using different ASP page. Everything is working fine. Now I want to create Navigation (Prev & Next) for the picture. I want to use session variables with arrays on it. Can anybody help me HOW??? Where??? Please help
Here is code:
I am working on images.I read the image files using File system objects and put them in the combo box to access. For this I'm using different ASP page. Everything is working fine. Now I want to create Navigation (Prev & Next) for the picture. I want to use session variables with arrays on it. Can anybody help me HOW??? Where??? Please help
Here is code:
Code:
<%dim selectedEvent
selectedEvent = Request.Form("event1")%>
<select style="width:100%;" id="event1" name="event1"
onChange="javascript:window.document.selectionForm.selEvent.value=window.document.selectionForm.event1.value;
javascript:window.document.selectionForm.selChoice.value="EVENT";
javascript:window.document.selectionForm.submit();" >
<%Dim fso
set fso = Server.CreateObject("Scripting.fileSystemObject")
Dim l_fldrname
l_fldrname ="d:\\Pictures"
Dim picFolder
set picFolder = fso.GetFolder(l_fldrname)
Dim subFolders
set subFolders = picFolder.subFolders%>
<%if selectedEvent = "" then%>
<option selected>Select Event</option>
<%else%>
<option >Select Event</option>
<%end if%>
<%For Each folder in subFolders
<option value ="<% Response.Write (folder.name)%>" selected ><% Response.Write folder.name%></option>
<%else%>
<option value ="<% Response.Write (folder.name)%>" ><% Response.Write folder.name%></option>
<%end if%>
<% end if
Next%>
</select>
...----------.............
<%dim selectedPicture
selectedPicture = Request.Form("picture1")%>
<%if selectedEvent = "" then%>
<select style="width:100%;" id="picture1" name="picture1" disabled>
<option selected value="">Select an event first</option>
<%else%>
<select style="width:100%;" id="picture1" name="picture1" >
<option selected value="">Select Picture</option>
<%
set picFolder = fso.GetFolder(l_fldrname & "\" & selectedEvent)
Dim files
set files = picFolder.files
For Each file in files%>
<%if selectedPicture = file.name then%>
<option value=<%Response.Write (file.name)%> selected> <%Response.Write fso.GetBaseName(file.name)%> </option>
<%else%>
<option value=<%Response.Write (file.name)%> > <%Response.Write fso.GetBaseName(file.name)%> </option>
<%end if
Next %>
<%end if%>
</select>
</td>
<td width="15%">
<a href="javascript:window.document.selectionForm.selPicture.value=window.document.selectionForm.picture1.value;
javascript:window.document.selectionForm.selEvent.value=window.document.selectionForm.event1.value;
javascript:window.document.selectionForm.selChoice.value="PICTURE";
javascript:window.document.selectionForm.submit();"><img src="./images/go_off.gif" border="0" WIDTH="44" HEIGHT="27"></a>
</td>
........
<%
dim selChoice
dim selEvent
dim selPicture
dim iFrameURL
selChoice = Request.Form("selChoice")
selPicture = Request.Form("selPicture")
selEvent = Request.Form("selEvent")
iFrameURL = "showPicture.asp?selChoice=" & selChoice & "&selEvent=" & selEvent & "&selPicture=" & selPicture
if selChoice = "THUMBNAIL" then
Response.Write(" You are looking at thumbnails of all pictures in <b>" & selEvent & "</b> event.")
elseif selchoice="PICTURE" then
Response.Write(selEvent & ">" & selPicture)
end if
%>
<iframe width="100%" height="400%" frameborder="no" src="<%=iFrameURL%>">
</iframe>
<b>otherpage.asp has following code:</b>
dim selEvent
dim selChoice
dim selPicture
dim fromWhere
selChoice = Request.QueryString("selChoice")
selEvent = Request.QueryString("selEvent")
selPicture = Request.QueryString("selPicture")
if selChoice = "" then
selChoice=Request.QueryString("selChoice")
end if
if selEvent = "" then
selEvent=Request.QueryString("selEvent")
end if
if selPicture = "" then
selPicture=Request.QueryString("selPicture")
end if
fromWhere= Request.QueryString("fromWhere")
if fromwhere = "Thumbnails" then
call gobackicon("")
Response.Write("<br>")
end if
%>
<%select case selChoice
case "PICTURE"%>
<div align=center>
<img src='[URL unfurl="true"]http://www.dfdf.com/Pictures/<%=selEvent%>/<%=selPicture%>'>[/URL]
</div>
<%case "THUMBNAIL"%>
<%Dim fso
on error goto 0
set fso = Server.CreateObject("Scripting.fileSystemObject")
Dim t_fldrname
t_fldrname = "d:\...\...\Pictures\" & selEvent & "\thumbnails"
Dim thumbFolder
set thumbFolder = fso.GetFolder(t_fldrname)
'Response.Write t_fldrname
Dim t_files
set t_files = thumbFolder.Files
%>
<table width=100% cols=4>
<tr align=left id="picRow" name="picRow">
<% For Each file In t_files align=left id=""picRow"" name=""picRow"">")%>
<td id ="numCell" name="numCell">
<a href='[URL unfurl="true"]http://www.fgfg.com/Pictures/ShowPicture.asp?selChoice=PICTURE&selEvent=<%=selEvent%>&selPicture=<%Response.Write[/URL] (file.name)%>&fromWhere=Thumbnails'>
<img src='[URL unfurl="true"]http://www.sdfsdf.com/Pictures/<%=selEvent%>/thumbnails/<%[/URL] Response.Write (file.name)%> ' border=0>
<br><%Response.Write fso.GetBaseName(file.name)%></br>
</a>
</td>
<% Next %>
</tr>
</table>
<%end select%>