Saving HttpResponse/Request to file system

Posted by chrisjlong on Stack Overflow See other posts from Stack Overflow or by chrisjlong
Published on 2010-03-15T20:43:46Z Indexed on 2010/03/15 20:49 UTC
Read the original article Hit count: 331

Filed under:
|
|

Here is my scenario. User fills out this large page which is dynamically created based off DB values. Those values can change. When the user fills out the page and hits submit we want to save a copy of the page as html on the server, this way if the text or wording changes, when they go back to view their posted information, it is historically accurate.

So I basically need to do this

protected void buttonSave_Click(object sender, EventArgs e)
{
    //collect information into an object to save it in the db       
    bool result = BusinessLogic.Save(myBusinessObject);

    if (result)
        //!!! Here is where I need to save this page as an html file on my servers IFS!!!!
    else
        //whatever

    Response.Redirect("~/SomeOtherPage.aspx");
}

Any help is greatly apprciated. Also I CANNOT just request the data from the url because query string parameters are a big no no in this case. The key to pull the database info up (at its highest level) is all in session so I cant just request a url and save it.

Thanks!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about screen-scraping