Forums

ASP

This topic is locked

target="blank" and response.write

Posted 29 Apr 2008 19:53:02
1
has voted
29 Apr 2008 19:53:02 joel minton posted:
Hello Gurus,

Here is my situation:

I have an asp page that displays the contents of a folder and creates links to the files [pdfs] for download.
This asp page is displayed in an Iframe. [I cannot change this right now]
I am looking for assistance in opening the link to the file[s] in a new window or a way to break out of the Iframe.

It is line 10 that is giving me trouble. Any help is greatly appreciated.


Here is the current code:


set FileSysObj=CreateObject("Scripting.FileSystemObjec t"
strFileAndPath = request.servervariables("SCRIPT_NAME"
strPathOnly = Mid(strFileAndPath,1 ,InStrRev(strFileAndPath, "/")
strFullPath = server.mappath(strPathOnly)
set fldr=FileSysObj.GetFolder(strFullPath)
response.write("<H2></H2>"
set FolderList = fldr.SubFolders
For Each FolderIndex in FolderList
Response.Write ("<A HREF='" & FolderIndex.name & "'>" & FolderIndex.name & "</A><BR>"
Next
set FileList = fldr.Files
For Each FileIndex in FileList
'This bit excludes this page (and other asp files) from the list of links
if Lcase(right(FileIndex.Name, 4)) <> ".asp" then
Response.Write("<A HREF='" & FileIndex.name & "'>" & FileIndex.name & "</A></BR>"
end if
Next

I have tried adding TARGET="_top" and TARGET="_blank" to the Response.Write. That didn't seem to get it done. I must be missing something here. I can't seem to get it working....

I have searched the forums as well but could not fine anything that helped my situation.

Thanks in advance.

Joel

They have the internet on computers now?

Reply to this topic