Disable right click on Pdf using asp.net

Posted by Pradeepmanne under ASP.NET on 10/8/2013 | Points: 10 | Views : 10631 | Status : [Member] | Replies : 4
hi,

Is it possible to open pdf file in asp.net web page without print,save and save as etc options
or how to Disable right click on Pdf using asp.net




Responses

Posted by: Brahmam on: 10/9/2013 [Member] Starter | Points: 25

Up
0
Down
<script language="JavaScript" type="text/javascript">
//Message to display whenever right click on website
var message = "Sorry, Right Click have been disabled.";
function click(e) {
if (document.all) {
if (event.button == 2 || event.button == 3) {
alert(message);
return false;
}
}
else {
if (e.button == 2 || e.button == 3) {
e.preventDefault();
e.stopPropagation();
alert(message);
return false;
}
}
}
if (document.all) {
document.onmousedown = click;
}
else {
document.onclick = click;
}
</script>

brahmam

Pradeepmanne, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Samirbhogayta on: 10/17/2013 [Member] Starter | Points: 25

Up
0
Down
hi..

//To disablerightclick in the application

document.onmousedown = disableclick;
status ="Right click option is not allowed";

function disableclick(e)
{
if (event.button == 2)
{
alert(status);
return false;
}
}

SAMIR
Sr. Software Engineer

Pradeepmanne, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nithish on: 5/23/2018 [Member] Starter | Points: 25

Up
0
Down
Hi, do you got any solution for disable right click on pdf ?

Pradeepmanne, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Logitechlivechat on: 5/31/2018 [Member] Starter | Points: 25

Up
0
Down
Logitech Live Chat presents to you the snappiest arrangement on a solitary call. We are always available for you to resolve your problem. For any doubt in your Logitech device call us at our Logitech Live Chat +1-800-712-0805 (Toll-free) USA. Logitech Support is a team of experts, ready to serve you 24*7 through our top-notch services
http://www.logitechsupportnumber.com/services-support/logitech-live-chat

Pradeepmanne, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response