G
Guest
Hello,
the scenario:
There's an ASPX page which shows some text and has three buttons at the
bottom: Save, Print and Close. Print and close is done by javascript. But how
can I save the page on the client's computer? He/she could do this using the
browser (file/save), but I need to have it done by pressing the pushbutton.
In my serverside code I get the button-click-event, I also know how to get
data to the client (including file-save-dialog), but where can I get the
page's content?
The download code could look like this (with ??? being actually my question):
Response.AddHeader("Content-Disposition", "attachment;
filename=Contract.html");
Response.AddHeader("Content-Length", ???.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Write(???);
Response.End();
Maybe I'm completely wrong and there is an other better way to do it. Please
help!
the scenario:
There's an ASPX page which shows some text and has three buttons at the
bottom: Save, Print and Close. Print and close is done by javascript. But how
can I save the page on the client's computer? He/she could do this using the
browser (file/save), but I need to have it done by pressing the pushbutton.
In my serverside code I get the button-click-event, I also know how to get
data to the client (including file-save-dialog), but where can I get the
page's content?
The download code could look like this (with ??? being actually my question):
Response.AddHeader("Content-Disposition", "attachment;
filename=Contract.html");
Response.AddHeader("Content-Length", ???.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Write(???);
Response.End();
Maybe I'm completely wrong and there is an other better way to do it. Please
help!