Disable right click on images or page in Asp.Net using jQuery


In this post, we will discuss how we can disable right click on images or disable right click on pages in Asp.Net using jQuery.
Also, check out:
Below is the code to disable right click on images using jQuery:
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script>
    <script type=”text/javascript”>
     $(function () {
            $(‘img’).on(“contextmenu”, function () {
                return false;
            });
        });
</script>
Below is the code to disable right click on page using jQuery:
<script type=”text/javascript”>
     $(function () {
            $(this).on(“contextmenu”, function () {
                return false;
            });
        });
</script>
Hope this will be helpful to you.
Check out Best Alternative to InfoPath -> Try Now

FREE SHAREPOINT 2019 PDF


New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

(Installation & Features)



About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →