Solved

ASP.NET Stop users from Email Webpage

Posted on 2009-05-06
8
217 Views
Last Modified: 2012-08-13
Is this possible. I can stop the body of the page from printing when they click the print button.  Is there a way to stop users from email the page from File.Send To?

I know Javascript might be an option.  I just wondered is there is a command from the body tag that I could use.
0
Comment
Question by:aninec
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24314791
No way to do this in .net since the command is fired by the browser "client side" and the code you write would be run on the server.

Javascript is likely your only option here, or maybe an active X component (browser plugin).
0
 
LVL 39

Expert Comment

by:abel
ID: 24314907
It is not possible to prevent that. Not by JavaScript and not from the serverside. You may try to create a plugin (XUL for FireFox, ActiveX for Microsoft IE) and ask the users to install it, but you may find some reluctance there.

Btw, you cannot stop the body of the page from printing when they click the print button. You can pull some tricks which may make it slightly harder, but anybody who wants to print your page can and will do that. Internet is a huge open source area and everything that can be viewed can be printed.

Even in the case where you manage to tie the hands of the end user, he or she can still print it by using printscreen, using another browser, disabling javascript, css or plugins, or simply using an older browser.

Same for emailing, which is just equal to save as, which is something you cannot prevent either.

If you want your content protected, you should publish it with PDF, which has protection mechanisms build in (which can, you guessed it, also be bend).
0
 

Author Comment

by:aninec
ID: 24319223
This is for an intranet and I am trying to protect content. I think I can use Javascript to control what the users can see.  Most would not have a clue that they could get around the coding...and the rest could careless.

Thanks for the assistance.  Now I need to figure how to code it for No toolbar and menu when the page loads up.
0
 
LVL 39

Expert Comment

by:abel
ID: 24319312
seems to be the day... You're the second that asks that today ;-)

The only way to manipulate the appearance of the browser (whether your users will see it as an annoyance is another subject) is by opening a new window. However, at any time, with all modern browsers, the user can get all buttons etc back. Furthermore, in most browsers it is now a custom that new windows are blocked anyway, and if not, they open in a new tab, which will still show the buttons and menu. And there's no way, no way at all (unless you write a plugin) to remove them. And even if you would manage (let's say by exploing a hole in the security), you will be considered a virus, I'm afraid....
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 39

Expert Comment

by:abel
ID: 24319333
But really: protecting content from the ones that do not know how to steal the content anyway, is not really going to bear fruit. And the ones that do want to steal your content, will know there ways around (and in the end it is only one click away to disable javascript).

Your best bet will be to deliver your protected content in any which way but HTML.
0
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24372930
what about rendering the content in a new window with no toolbars and preventing right clicks.
that doesn't stop "print screen" of course but it does prevent direct printing to a printer.

Sharepoint has an option to do this with a document, how does sharepoint do it?
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24373011
what about the following (really you can't do much if somebody wants to print your page), which becomes more and more common as default settings... (other browsers have similar ways).

The only serious option is rendering your page as PDF, with the security bits set for printing.

If you want to be particularly annoying to users who want to print your page, add the following in your CSS file, it will have the average user look at a blanco page if (s)he prints it:

@media print 

{

   * {

       display: none !important;  

      /* the imp. will prevent user-overriding settings in many cases */

   }

}

Open in new window

ScreenShot274.png
0
 
LVL 4

Expert Comment

by:Wardy_01
ID: 24373130
oooo good call abel ... i like the css option ... cllean :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now