JQuery to Disable Right Click Mouse Button in Asp.Net C# VB.Net

In some special cases we need to disable mouse right click for some protection purposes. Here in this small JQuery Tip I will show “How we can disable mouse right button in a web page using JQuery“.

Related Articles:
1. JQuery to Disable Right Click Mouse Button on a Specific Area of a Page in Asp.Net C# VB.Net
2. JQuery to Disable Right Click Mouse Button on all Images in Asp.Net C# VB.Net

Objective/Outcome:
JQuery to Disable Right Click Mouse Button in Asp.Net Csharp VB.Net

JQuery code to Disable Mouse Right Click:

<script type="text/javascript">
    $(document).ready(function () {
        $(document).bind('contextmenu', function () {
            alert('Right Click is not allowed here !!');
            return false;
        });
    });  
</script>

Hope now you can protect your resources, though it’s too tough.

Script tested for:
1. Internet Explorer
2. Mozilla Firefox
3. Google Chrome
4. Opera

Download Code Example C#        Download Code Example VB.Net

Posted in .Net, Asp.net, C#, Client, JQuery, VB.Net

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code
     
 

*