By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,619 Members | 2,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,619 IT Pros & Developers. It's quick & easy.

Saving HTML Pages

P: n/a
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.
TIA
Clay
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"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
Nov 18 '05 #2

P: n/a
If all you want to do is to save away one http://xxx/a.aspx's generated HTML
saved off by a different http://yyy/gethtml.aspx page, you can use
HttpWebRequest class to get the generated HTML and save it off. is that what
you are looking for?

"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.
TIA
Clay

Nov 18 '05 #3

P: n/a
Thank you for your help!

Clay
"Girish bharadwaj" <gi*****@mvps.org> wrote in message
news:u3****************@TK2MSFTNGP10.phx.gbl...
If all you want to do is to save away one http://xxx/a.aspx's generated
HTML
saved off by a different http://yyy/gethtml.aspx page, you can use
HttpWebRequest class to get the generated HTML and save it off. is that
what
you are looking for?

"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.
TIA
Clay


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.