#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    16

    Redirect Response.write ouput


    I've got a function that I wrote sometime ago that outputs a lot of content via response.write's. At this time I'd like to email everything that the function writes via response.write's. So I was wondering if there is anyway to redirect the response buffer to a string? Is this possible and does anyone know how to do it? Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    I don't think you can redirect the response but a good work around would be to make your own response object and do a string replace "response" with "myresponse" on the code.

    You will need a dummy function for every response object function you use in your code. I have only replaced the "write" function

    use myResponse.getString to get your string

    Code:
    <%
    Set myResponse = new resp
    
    myResponse.write "fred"
    
    response.write myResponse.getString
    
    class resp
      Dim buffer
      public function write(byVal str)
        buffer = buffer & str
      End Function
    
      public function getString()
        getString = buffer
      End Function
      
    End Class
    
    %>
    --

    ngibsonau

IMN logo majestic logo threadwatch logo seochat tools logo