"Clay Black" <tw*@two.com> wrote in message
news:uY**************@TK2MSFTNGP14.phx.gbl...
I need to find a way to save an HTML page to the IIS server. What I need
is to have a button that once it is clicked the current page being
displayed is saved to a location on the local IIS server. I know there are
ways to go and get a page, but this one would be dynamic and wouldn't be
saved so I would need to save it while it is still active or have it
forwarded to an asp.net page that will take the html code and save it to a
file.
Clay, let's see if I have your request right:
1) Your user requests a page, perhaps by typing the URL into the address bar
in their browser
2) ASP.NET on the server sends some HTML back to the browser.
3) The browser loads and begins rendering the HTML, but the HTML likely
requires other resources, so
4) the browser begins requesting the other resources, like images,
stylesheets, etc., which are referenced in that HTML.
5) Eventually, the browser is finished rendering the HTML and resources, and
your user clicks a button which was part of the HTML
6) You want that button to cause "the HTML page" to be sent to "the local
IIS server"
Questions:
1) Do you only want the HTML to be sent, or do you also want the images?
2) When you say "the local IIS server", do you mean the server which sent
the original HTML, or some other server? Are web farms a consideration?
3) Where would you like the page to be stored? Would it be ok if it were
stored in one particular directory? Would it be ok if the saved page had a
random file name? You obviously don't want several users saving
"default.aspx" to the same directory.
4) You say "this one would be dynamic and wouldn't be saved". I presume you
mean that you got an error message when you tried to use File->Save As? If
so, note that anything you do to "save" the page will see the same problem.
In particular, you won't be able to save any changes made to the page by any
script running on the page, and you won't be able to save the state of any
applets or ActiveX controls. Also, if any of the images or other resources
used non-static URLs like this:
<img src="getimage.aspx?imageid=<something dynamic>">
then you won't know what image the user saw.
Perhaps if you gave more detail on what you need to do, we could help you
find an alternative?
John Saunders