Response.Write into an iFrame

Discussion in 'C#' started by PHP_Tyro, May 30, 2008.

  1. #1
    I have some Asp code which cycles through all the files in a folder and writes out those filenames that conform to a specific filter.

    Writing the filenames one under the other to the webpage works fine, however I want to improve the user interface and write the list of filenames into a scrolling iFrame, but I can't figure out if it's possible to Response.Write directly into the iFrame?

    At the moment the code looks like this (simplified for the purposes of this question):

    Dim objFSO, objFolder
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(oFolder)

          'Loop through the Files collection and list all available documents.
          Dim objFile, oCmdLine
          For Each objFile in objFolder.Files
                oCmdLine = "<a href=" & """"
                oCmdLine = oCmdLine & oURL
                oCmdLine = oCmdLine & objFile.Name & """" & ">"
                oCmdLine = oCmdLine & objFile.Name
                oCmdLine = oCmdLine & "</A>"
                oCmdLine = "<li>" & oCmdLine & "</li>" & "<br>"
                Response.Write(oCmdLine)
          Next
    Code (markup):
    As you can see I'm presenting the files as clickable links.

    Anyway, I need to change the last line in the loop so each file is written into the iFrame, instead of being written to the webpage as it is at the moment.
     
    PHP_Tyro, May 30, 2008 IP
  2. PHP_Tyro

    PHP_Tyro Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    OK, apparently it can't be done with an iFrame.

    The solution I have adopted is a scrolling div, which works fine for my purposes.
     
    PHP_Tyro, May 30, 2008 IP
  3. iconico

    iconico Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The iframe is a seperate file, so you'll need to do your response.write in the iframe's file.

    And yes a scrolling div would also be an approach.
     
    iconico, Jun 10, 2008 IP
  4. bclassic

    bclassic Peon

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    not quite understand what the question is.
    but they look like only two windows
     
    bclassic, Jun 11, 2008 IP