Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,

i have created one webpage in asp.net.

i want to protect this Page, in which page should not be allowed to be edited after copying and pasting in MS word or any other editor. Any print screen, cut, copy, paste function should aloow the html page to be copied as an image and not as texts which can be edited.


anybody,Please suggest me.
Posted

It is impossible to display text as text, allow it to be copies, but stop it from being changed once it is copied. Once the text is on the clipboard, you have lost control over it. I do have a couple ideas for you to think through though.

The first thing I would do would be to look at why you are trying to protect your text. Is it really necessary? The whole point of a website is that you are sharing information. What people choose to do with that information, to an extent, is up to them. Even if this were technically possible, they could still transcribe the data to Word and then manipulate it.

If you really feel that certain text must be protected and must remain unchanged, you could convert that text to an image. Then they could download the image but they couldn't easily manipulate the text. Here is a tip on how to do that:

Convert Text to Image[^]

This isn't a solution you want to do for your whole page, but it could work for sections that are going to remain static anyway.

You could also create a user agreement that has to be agreed to before the visitor can see your page. Something simple that says "I will not modify the text I see" or something to that effect.
 
Share this answer
 
Comments
omprakash katre 15-Jun-12 8:07am    
thanks for quick reply,but its client requirement.
Tim Corey 15-Jun-12 8:17am    
Well, I understand, but my answer stands. The only thing you can do is create images instead of text for your site but it won't be dynamic (you can't easily change the text after it is an image) and it won't be pretty. Otherwise, it is the only way I can see to get anywhere near your requirements. Requirements have to be reasonable. If they aren't, it is your unenviable job to communicate that to the client. Sorry.
It is impossible, I have only Disable select, copy and paste of the content

C#
//disable cut copy past
    var message = "";
    function clickIE() { if (document.all) { (message); return false; } }
    function clickNS(e) {
        if(document.layers || (document.getElementById && !document.all)) {
            if (e.which == 2 || e.which == 3) { (message); return false; }
        }
    }
    if (document.layers)
    { document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clickNS; }
    else { document.onmouseup = clickNS; document.oncontextmenu = clickIE; }
     document.oncontextmenu = new Function("return false")

    //for disable select option
    document.onselectstart = new Function('return false');
    function dMDown(e) { return false; }
    function dOClick() { return true; }
    document.onmousedown = dMDown;
    document.onclick = dOClick;
 
Share this answer
 
v2

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