ASP.NET Disable right click on web page and images using jquery

ASP.NET Disable right click on web page and images using jquery

Today, We want to share with you ASP.NET Disable right click on web page and images using jquery.In this post we will show you Disable right click on web page and images in asp.net, hear for Disable right click on images using jquery in asp.net we will give you demo and example for implement.
In this post, we will learn about Disable Mouse Right Click in ASP.Net (ASPX) Page using JavaScript with an example.

Read Also:  laravel datatables Server-side Processing

Introduction: Disable right click on web page and images

In this post, we will learn about how to Disable right click on web page and images in asp.net.

NO RIGHT CLICK ON ASP.NET PAGE

Many a times it is required to prevent your web page images from being copied by someone else.This is an effective way to prevent your images from being copied or stolen.This trick will disable right click only on images. Add the below event handler to the img or image tag as shown below: NO RIGHT CLICK ON ASP.NET PAGE

Read Also:  Filter (Search) Table using Angular Example

Disable right click on images

<asp:Image ID="img1" runat="server" ImageUrl=""../ImgLoc/1.png"" oncontextmenu="return false;" />
<img alt="MyImage" src="../ImgLoc/2.png" oncontextmenu="return false;"/>

Disable right click on web page

You can disable right click on whole page by adding oncontextmenu handler in body tag of webpage. Now this will disable right click on each and every control of a webpage.

<html>
<head>
...
</head>
<body oncontextmenu="return false;" >
...
</body>
</html> 

Show alert on right click

<img src="../pakainfo/2.png" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<script>" title="<script>;" /> 
<body oncontextmenu=" return disableRightClick();">
... 
</body> 

Read :

Read Also:  Vue JS Get String length Property

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Disable right click on web page and images using ASP.NET.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.

->If you enjoyed and liked this post, don’t forget to share.

->I would like to have feedback from my blog readers.

->I hope after reading this article you will be able to do this.

About Pakainfo

I am Jaydeep Gondaliya, a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Pakainfo →

Leave a Reply

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