Re: Save ASPX page on client programmatically

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



@Norman:

You are right, the browser's save function would be fine for this. There are
two reasons why I need to have a button on the page for it:

reason 1: Without the intention to offend someone: there ARE users out there
who don't know THAT and HOW they can save a page displayed in their browser.
Since the document is a contract document and it is important that the user
can save it, (and does save it) a clearly visible save-button is the more
secure way to have the document saved.

reason 2: I am programming this for a customer and he WANTS the save-button.

Besides, if I would like to modify the content for formatting etc. I first
need to have the content. The ASPX page ist made of a form with text and
fields, how can I get the rendered content, I can't find it.

"Norman Yuan" wrote:

It depends on what do you want user to save. Since it is web application,
all user gets is a page rendered in a browser, according to HTML tags. If
you want user to save the page as it is, then the browser's "Save" menu is
what it means, why try to invent the wheel again. If what you want user to
save is the data displayed on the page, but in different format (say, PDF),
you need then to re-organise your data in wanted format and send to browser
as download stream. Or because of the current page has too many decorations,
you want to save a clean printable version, then you can simply make a plain
printable version of the page, to let user still be able to save with
standard browser "Save" command.

I do not see the point when user can save the page easily, while you still
want him to save the exactly same page as download via a "Save" button.


"FreeNEasy" <FreeNEasy@xxxxxxxxxxxxxxxx> wrote in message
news:B17FA360-4E60-41EA-A6F3-BC6CA159DF87@xxxxxxxxxxxxxxxx
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!



.



Relevant Pages

  • Re: Enabling apache2 and ssl - is there an easy way?
    ... For some reason, my browser tries to download the output of ... >I would need to see the relevant config to understand this one.. ...
    (Debian-User)
  • Re: how to restrict user from running some downloaded prgm?
    ... Well, for the reason part, here is a similar scenario. ... Some asian students work there. ... incentive to download a different version of browser, ... browser doesn't have their native language package. ...
    (comp.os.linux.security)
  • Dowloading Internet Explorer 6.
    ... to download the newest version of Internet Explorer so my Email will work on ... MSN Messanger(i try to open it and it says I need to download the lastest ... it says it cant download the Browser for ... some reason. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Event Matchmaker updated
    ... > "contact us" one for some reason. ... > actually cover your logo to the point that the logo isn't visible. ... > being resized by the browser. ... > - The FAQ pages don't look anything like any FAQ I've ever seen, ...
    (rec.juggling)
  • Re: onresize wakeup call in older FF
    ... These are people who have lived with this browser, ... arbitrary user of a current browser to upgrade, ... a false reason for a user of a long time obsolete browser. ... the desired functionality with a window.setInterval, ...
    (comp.lang.javascript)