Save Dynamic Page Programmatically
Hi,
I have an asp.net page, that is generated dynamically with response.writes, etc.
I need to be able save this page, possibly to the root.
The reason why is that everytime the user opens the page, new dynamic data will be genereted, and thus if they close the browser without saving, then they will not be able to get that information again.
Any help will be very appreciated.
Thanks :)
Re: Save Dynamic Page Programmatically
Do you display this data in some type of DataSet? And how important this data is?
If it's very important to keep this data, you can do it e-commerce style. Save the results on a database, for them to retrieve it later.
For example, if you are binding a DataSet to a Datagrid, you can save the XML of the DataSet in the db, for a very quick later retriaval.
Just an idea...
HTH
HoraShadow
EDIT:
Oh, I just read you are using response.write, so I guess my way doesn't work, unless you can think of a way to adapt it.
Re: Save Dynamic Page Programmatically
thanks for the info.
I will keep digging.
Re: Save Dynamic Page Programmatically
You can use a WebRequest class object to request the page you want, passing in whatever headers you want, receiving the response in a stream and then saving the stream to an HTML file.
Re: Save Dynamic Page Programmatically
Quote:
Originally Posted by mendhak
You can use a WebRequest class object to request the page you want, passing in whatever headers you want, receiving the response in a stream and then saving the stream to an HTML file.
awesome. Thanks.