Getting the entire document from response.

Discussion in 'ASP .Net' started by Josh Naro, Jun 20, 2007.

  1. Josh Naro

    Josh Naro Guest

    I am writing a module that requires the entire output from a web app
    to perform its function. So, basically I need to be able to pull the
    entire output stream from the Response object. I've tried attaching a
    custom filter to Response.Filter, but the custom filter receives the
    stream in separate chunks. I need the entire stream at once in order
    to convert it to an XmlDocument. Does anyone know of a way to get the
    entire output stream from a web app using a module?
    Josh Naro, Jun 20, 2007
    #1
    1. Advertising

  2. Josh Naro

    Josh Naro Guest

    On Jun 20, 9:54 am, Josh Naro <> wrote:
    > I am writing a module that requires the entire output from a web app
    > to perform its function. So, basically I need to be able to pull the
    > entire output stream from the Response object. I've tried attaching a
    > custom filter to Response.Filter, but the custom filter receives the
    > stream in separate chunks. I need the entire stream at once in order
    > to convert it to an XmlDocument. Does anyone know of a way to get the
    > entire output stream from a web app using a module?


    Well, I managed to figure this one out myself.

    Answer:
    1. Create a custom filter that makes use of the singleton pattern.
    2. Have the filter store each stream as it comes through in a public
    variable (i.e. temp += currentStream).
    3. Install the filter on BeginRequest of the application from within
    a module.
    4. Grab your filter on EndRequest of the application from within the
    module.
    5. Your singleton filter should now have the entire output of the
    application in its temp variable.
    Josh Naro, Jun 20, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msnews.microsoft.com

    Getting access to a page's entire html source

    msnews.microsoft.com, Apr 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    357
    Brock Allen
    Apr 3, 2005
  2. Sib

    scanf not getting entire long value

    Sib, May 16, 2005, in forum: C Programming
    Replies:
    6
    Views:
    484
    Kevin D. Quitt
    May 18, 2005
  3. Replies:
    1
    Views:
    358
    André Gillibert
    Dec 3, 2007
  4. Replies:
    1
    Views:
    341
    dorayme
    Dec 3, 2007
  5. Replies:
    1
    Views:
    96
Loading...

Share This Page