Rendering a Page's HTML to disk.

Discussion in 'ASP .Net' started by MattC, Oct 28, 2005.

  1. MattC

    MattC Guest

    Hi,

    Is there anyway of once a Page has finished Rendering to the Render that
    same HTML to disk?

    TIA

    MattC
     
    MattC, Oct 28, 2005
    #1
    1. Advertising

  2. MattC

    Rob Meade Guest

    "MattC" wrote ...

    >> Is there anyway of once a Page has finished Rendering to the Render that

    > same HTML to disk?


    There's probably a better way, but you can use a method of the XML stuff to
    read in a webpage (xmlhttp rings a bell?) - anyway, you could potentially
    read it in then save that string to a text file I guess...

    http://www.aspfaq.com/show.asp?id=2173

    As I said, I'm sure there's a better way..

    Rob
     
    Rob Meade, Oct 28, 2005
    #2
    1. Advertising

  3. MattC

    MattC Guest

    Well I cheated in the end and used to following:

    string m_OutputFile = "test.htm";

    StreamWriter sw = new StreamWriter(m_OutputFile,true);


    Server.Execute("mypage.aspx", sw);


    sw.Flush();


    sw.Close();



    MattC

    "MattC" <> wrote in message
    news:%...
    > Hi,
    >
    > Is there anyway of once a Page has finished Rendering to the Render that
    > same HTML to disk?
    >
    > TIA
    >
    > MattC
    >
     
    MattC, Oct 28, 2005
    #3
  4. MattC

    Phillip Ian Guest

    You might look at the HttpResponse.Filter property. According to help:
    "When you create a Stream object and set the Filter property to the
    Stream object, all HTTP output sent by Write passes through the
    filter."

    I'm not sure if that means everything on the page, or just things you
    explicitly do a response.write on. But worth trying.
     
    Phillip Ian, Oct 28, 2005
    #4
    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. Jas Shultz
    Replies:
    0
    Views:
    975
    Jas Shultz
    Dec 3, 2003
  2. sincethe2003
    Replies:
    2
    Views:
    563
    Craig Deelsnyder
    Jul 14, 2004
  3. Peter Mount
    Replies:
    4
    Views:
    977
    Peter Mount
    Jan 31, 2006
  4. Replies:
    12
    Views:
    529
    santosh
    Nov 15, 2006
  5. Jake Barnes
    Replies:
    6
    Views:
    417
    9.co.uk
    Feb 8, 2006
Loading...

Share This Page