Click here to Skip to main content
15,892,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Developer,
i have a asp page in which i want to restrict user to not to copy its content.
For that i am using some code inside JavaScript :

document.oncontextmenu = function(){return false;};
document.onselectstart= function() {return false;};

it works very fine with pages in which i do not apply CSS. If a page is using CSS then it works only with in some TD tag where i do not apply any CSS.

Suggest me so that i can restrict user to copy any content in my asp page...


Thanks in Advance...
Posted
Updated 6-Dec-12 20:00pm
v3
Comments
bbirajdar 10-Dec-12 9:12am    
What if the user saves the webpage using the 'Save As' option from the browser menu ???? :)

If i understood it correctly, You can use user-select CSS3 property...
HTML:
HTML
<span class="protected">Datas you wants protect</span>

CSS :
CSS
.protected {
    -moz-user-select:none;
    -webkit-user-select:none;
    user-select:none;
}
 
Share this answer
 
document.oncontextmenu = function(){return false;};
document.onselectstart= function() {return false;};


With right CSS Style file
 
Share this answer
 

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