disable buttons when printing an asp page

R

Rahul Chatterjee

Hello All

I have a web page which is a confirmation page giving a receipt. I have a
couple of buttons on that page - one of them is a print button which is a
javascript:window.print() command on the onClick event. The problem I am
facing is that it prints the page along with the buttons. Is there any way
to disable the printing of the buttons through the code itself. Also is
there any way to disable the header and footer url and titles that print. I
know we can do this through the settings on the print control but I dont
want the user to have to do this. When they print I want them to be able to
just print the confirmation page minus the command buttons and the URL's
etc.


Also is there any way to disable the browser back arrow function on this
page only.

Please advise

Thanks
 
R

Roland Hall

in message
: Hello All
:
: I have a web page which is a confirmation page giving a receipt. I have a
: couple of buttons on that page - one of them is a print button which is a
: javascript:window.print() command on the onClick event. The problem I am
: facing is that it prints the page along with the buttons. Is there any way
: to disable the printing of the buttons through the code itself. Also is
: there any way to disable the header and footer url and titles that print.
I
: know we can do this through the settings on the print control but I dont
: want the user to have to do this. When they print I want them to be able
to
: just print the confirmation page minus the command buttons and the URL's
: etc.

I use two CSS files linked in a popup window for the receipt by building the
page dynamically:

<link rel='stylesheet' type='text\/css' href='/css/printstyles.css'
media='print' \/>
<link rel='stylesheet' type='text\/css' href='/css/screenstyles.css'
media='screen' \/>

The media= defines screen or printer. In the printstyles.css file, I set
any elements I want to turn off with display: none.

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top