You must Sign In to post a response.
  • Category: ASP.NET

    in IE disable right click and copy shortcut in all browser

    I want to disable right click, Copy paste command ctrl+A,Ctr+C in asp.net. In chrome its working but there is a problem in IE 11. please let me know if you have any solution for the same ASAP.
  • #765187
    Hi Vinod,

    I suggest you to refer below links this might be helpful to you.

    http://www.dotnet-tricks.com/Tutorial/jquery/D9UO110612-Disable-cut,-copy-and-paste-in-textbox-using-jquery,-javascript.html
    http://www.codexworld.com/disable-mouse-right-click-cut-copy-paste-using-jquery/

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #765190
    You need to use either javascript or JQuery for it
    following snippet should work for all browsers to disable right click
    //in aspx
    <body oncontextmenu="return false">
    ...
    </body>

    //javascript
    <script language="javascript">
    document.onmousedown=disableclick;
    status="Right Click Disabled";
    function disableclick(event)
    {
    if(event.button==2)
    {
    alert(status);
    return false;
    }
    }
    </script>

    disable copy paste for all browsers
    <body oncopy="return false" oncut="return false" onpaste="return false">

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments