How To Make ASP.NET 2.0 Web Application Copy Protected

Last post 05-09-2008 10:37 AM by RSSole. 4 replies.

Sort Posts:

  • How To Make ASP.NET 2.0 Web Application Copy Protected

    05-08-2008, 5:39 AM
    • Loading...
    • arvindmewara
    • Joined on 08-22-2007, 11:21 AM
    • Mumbai
    • Posts 46

    hello All,

    i m new in asp.net.

    i m  developing a web application using asp.net, vb.net, SQL Server 2005 and ajax.

    what i want when user try to copy my web application content(Text & Images) than he will not Succeed.

    And he will also not able to view source. using Menu->View->View Source

    pls try to help me ass soon as possibile.

    thanks for your time

    Regards,

    Arvind

  • Re: How To Make ASP.NET 2.0 Web Application Copy Protected

    05-09-2008, 12:29 AM

    That is not really possible to completely disable being this is a web application. The images and text need to be downloaded by the browser in order to render on the client, therefore they will end up being in the user's cache directory anyway.

     The best you could do is to use javascript to disable right-clicking on the images on your pages, so the less knowledgeable users won't be able to "Save Image As...".
     

  • Re: How To Make ASP.NET 2.0 Web Application Copy Protected

    05-09-2008, 4:50 AM
    • Loading...
    • arvindmewara
    • Joined on 08-22-2007, 11:21 AM
    • Mumbai
    • Posts 46

    ok than tell me how this web site did all this.

     

    http://www.isquareit.ac.in/applicationprocess.htm

    check this url and click on online registration link.

    one new page will open for registration, now check are you able to copy text, select text and view html source?

    and let me know

  • Re: How To Make ASP.NET 2.0 Web Application Copy Protected

    05-09-2008, 9:43 AM
    Answer

    You could use javascript to disable selecting text and right-clicking. It won't be a foolproof method though since the user could just disable javascript in their browser.

     

    Use this to disable right click:

    <script language="JavaScript1.2">
    if (window.Event)
    document.captureEvents(Event.MOUSEUP);

    function nocontextmenu(){
    event.cancelBubble = true, event.returnValue = false;
    return false;
    }

    function norightclick(e) {
    if (window.Event) {
    if (e.which == 2 || e.which == 3) return false;
    }else if (event.button == 2 || event.button == 3){
    event.cancelBubble = true, event.returnValue = false;
    return false;
    }
    }

    if (document.layers)
    document.captureEvents(Event.MOUSEDOWN);

    document.oncontextmenu = nocontextmenu;
    document.onmousedown = norightclick;
    document.onmouseup = norightclick;
    //-->
    </script>
     Then this is disable selection:
     
    <script language="JavaScript1.2">
    
    function disabletext(e){
    return false
    }
    
    function reEnable(){
    return true
    }
    
    //if the browser is IE4+
    document.onselectstart=new Function ("return false")
    
    //if the browser is NS6
    if (window.sidebar){
    document.onmousedown=disabletext
    document.onclick=reEnable
    }
    </script>
     
  • Re: How To Make ASP.NET 2.0 Web Application Copy Protected

    05-09-2008, 10:37 AM
    • Loading...
    • RSSole
    • Joined on 07-03-2006, 8:48 AM
    • Posts 56

    Just like I thought...it is only working in IE (try opening it in another browser) so if you go for such approach prepare yourself for hell to make it cross-browser but if cross-browser is not your concern...

Page 1 of 1 (5 items)