Forum Moderators: open

Message Too Old, No Replies

Moving a link into an IFRAME

between to different .asp files

         

Andrew Thomas

9:58 am on Mar 28, 2002 (gmt 0)

10+ Year Member



I have two files, the first code 'filestructure.asp' opens explorer and displays all the files within the folder. When a file is clicked it is opened in another window

The second page is my web page 'orders.asp' which has an iframe.

The problem?

I want to display the file i open in 'filestructure' to be displayed in the iframe on the orders.asp page.

Any ideas, here is a snippet the code so far...

filestructure.asp

dirname="/gpc catalogue/orders"
mypath = "orders/"
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(server.mappath(dirname))
Set filez = folder.Files
FileCount = folder.Files.Count
response.write "<center><font size=1>There are "
response.write "<b><font size=2>"
response.write FileCount & "</b></font>"
response.write " orders.</font></center><p>"
For Each listing in filez
TotalChars = len(listing.name)
Title = left(listing.name,TotalChars - 4)
Title = replace(Title,"_"," ")
response.write "<A HREF='" & mypath
response.write listing.name
response.write "' class=""menu"" target=""_new"">"
response.write Title
response.write "</A><br>"
Next
%>

Orders.asp (iframe for the link to be displayed)

<iframe src=" this is where i want the filestrure page to open" border=3 frameborder=0 marginheight=0 marginwidth=0 width="100%" height="100%" name="iframeElement" id="iframeElement" scrolling=none></iframe>

thanks for the help...

Xoc

1:11 pm on Mar 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<iframe src="filestructure.asp" border="3" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" name="iframeElement" id="iframeElement" scrolling="none"></iframe>

Should work. I'm not where I can test it, though.

Andrew Thomas

1:54 pm on Mar 28, 2002 (gmt 0)

10+ Year Member



Thanks, but i didnt really mean that...

I want to open filestructure in a blank explorer, which contains linked files on my desktop (.txt and .html) When i click on these linked files i want those files to appear in the iframe.

but thanks for answering..

korkus2000

2:07 pm on Mar 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



pass the iframe source through your query string if its a link and just a request.form if its a form. Make the Iframe source an asp variable. grab the address and populate.

filestructure.asp

response.write "<A HREF='orders.asp?path=" & mypath
response.write listing.name
response.write "' class=""menu"" target=""_new"">"
response.write Title
response.write "</A><br>"

Orders.asp

iframeSource = request.querystring("path")

<iframe src="<%= iframeSource %>" border=3 frameborder=0 marginheight=0 marginwidth=0 width="100%" height="100%" name="iframeElement" id="iframeElement" scrolling=none></iframe>

If you want the links on the same page as the Iframe just link or post to the same page.

Andrew Thomas

2:15 pm on Mar 28, 2002 (gmt 0)

10+ Year Member



Cheers, thanks a lot...

What would i do without all your help.....

but im learning to..