There might be an easy way to do this but I don't know any. What you could do would be to use media style sheets. Do something like - have all your code in a div and use a print media style sheet to hide the div. That way, when someone tries to print the page, all that will print will be an empty page.
You could also have a second div that contains a message - "You do not have permission to print this page". Set up two media styles. Screen view will show the first div and print view will print your message.
I have this working on one of my pages as follows:
<STYLE>
@media print {
#screenView {display: none;}
#printView {display: block;}
#TOP {display: none;}
#BOTTOM {display: none;}
}
@media screen {
#screenView {display: block;}
#printView {display: none;}
#TOP {display: block;}
#BOTTOM {display: block;}
}
</STYLE>
For the screen view, three DIV's are visible. However, when the user tries to print the page, it only prints one of the DIV's.
Hope that helps. Mise Le Meas,
Mighty
