Writing HTML To A File
===

I have a table that is partially populated by the user and I would like to save the resulting HTML to a file.  The code I am using is:

    WebClient myClient = new WebClient();
    string myPageHTML = null;
    byte[] requestHTML;
    string currentPageUrl = Request.Url.ToString();
    UTF8Encoding utf8 = new UTF8Encoding();
    requestHTML = myClient.DownloadData(currentPageUrl);
    myPageHTML = utf8.GetString(requestHTML);
    string outputFileLocation = currDir + "\\" + "outputFile.html";
    FileStream fs = File.Open(outputFileLocation, FileMode.Create, FileAccess.Write);
    using (StreamWriter sw = new StreamWriter(fs))
    {
        sw.WriteLine(myPageHTML);
    }

The problem seems to be that this code sends a new request for the page so that I end up getting the initial page view and not the HTML resulting from user input.

Any advice is appreciated.

Regards.
