![]() |
|
|
#1 (permalink) |
|
Registered User
Join Date: Sep 2003
Posts: 14
|
Response.Write Issue
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....
__________________
_____________________ They have the Internet on computers, now? |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Sep 2003
Posts: 14
|
Hi Paul,
Thanks for the reply. When the link is processed the associated file [pdf] opens whatever default pdf viewer is on the client in the iframe. That is my current problem. What I am trying to achieve is to have the asp create the the link [it is doing this already] but have it targeted to a new window. I think I am definitely missing something when I add a target="_blank" to the response.write string. I am just having one of those moments where I just can't see it. ORIGINAL: Response.Write("<A HREF='" & FolderIndex.name & "'>" & FolderIndex.name & "</A><BR>") MOD: Response.Write("<A HREF='" & FolderIndex.name & " target='"_blank">" & FolderIndex.name & "</A><BR>") Here is an example. http://sharonct.org/pdfs/iframelinkerparent.asp
__________________
_____________________ They have the Internet on computers, now? |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Sep 2003
Posts: 14
|
OK.
Got it sorted. Response.Write("<A HREF='" & FileIndex.name & "'>" & FileIndex.name & "</A></BR>") should have been Response.Write("<A target=""_blank""HREF=" & FileIndex.name & ">" & FileIndex.name & "</A></BR>""") bourbon and sleep fixed it... Thanks for looking Paul!
__________________
_____________________ They have the Internet on computers, now? |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|