how to save the out html to a html file on server disk automatically ?

S

sincethe2003

The .aspx output html text to client browser,
how to save the out html to a html file on server disk automatically ?
 
C

Craig Deelsnyder

sincethe2003 said:
The .aspx output html text to client browser,
how to save the out html to a html file on server disk automatically ?

Change the response's content type to

Response.ContentType = "application/octet-stream"

before outputting any HTML...

you can also add
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")

and try to set a default filename, but if I remember this doesn't work
all the time
 
C

Craig Deelsnyder

Craig said:
Change the response's content type to

Response.ContentType = "application/octet-stream"

before outputting any HTML...

you can also add
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")

and try to set a default filename, but if I remember this doesn't work
all the time

gah, sorry, didn't notice you wanted server instead...my soln was for
saving at the client

http://www.c-sharpcorner.com/Code/2003/July/OutputASPtoHTML.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top