Click here to Skip to main content
15,920,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am opening a page in asp.net using window.open() function .....
in opened page v can copy(ctrl a) and paste (ctrl v)...
how could i prevent the copy/paste of that page
Posted
Comments
Joan M 3-Aug-12 3:53am    
Imagine that your user prints the screen and then goes through an OCR software to recognize text.

Bad approach. You won't be able to avoid that.

You can't. Once you have presented the page to their browser, the user can do what they want with it. No matter what you do to try and stop them, there's always a way around it.

I suspect this is not the answer you wanted, but anything else is a lie.

Peter
 
Share this answer
 
Comments
enhzflep 3-Aug-12 5:31am    
Short and succinct. My +5
Have a look:
You can use `user-select` CSS3 propertie

HTML like this :
HTML
<span class="protected">Datas you wants protect</span>


And the correspondant CSS :
CSS
.protected {
        -moz-user-select:none;
        -webkit-user-select:none;
        user-select:none;
    }


See an example : http://jsfiddle.net/DoubleYo/RPv4q/[^]

This solution is not cross browser but work fine with firefox and chrome/safari

Advanced user can copy your content with view the page source, make pdf or print your page, and some people mention firebug, fiddler.
Ref.: Disable copying data from webpage[^]

..and more for reference:
Prevent Cut, Copy and Paste Operations in an ASP.NET TextBox using jQuery[^]
Disable Copy Paste cut options in textbox using javascript in asp.net[^]
Disable Copy Paste Right Click Using JavaScript In Asp.Net TextBox[^]

..and more threads on google[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900