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.
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
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>
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.