I am developing one web application using asp.net(vb.net), in this application, I have to display excel,word,powerpoint and pdf files in my browser but restrict the user to save that file and also disable cut,copy,paste,mouse right click and print options.
Please help me out ASAP from this problem.
Thanks
Loading
Bechir BejaouiPosted Jun 8, 2008, 10:24 AM
//*Written by Ravi Shankar Bhatia
//*The above information may not be removed ..For help please email: [email protected]
//********************************/
PopUpURL = "The right click options are disabled for this window";
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
if (isIE||isNN)
{
document.oncontextmenu=checkV;
}
else
{
document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
document.onmousedown=checkV;
}
function checkV(e)
{
if (isN4)
{
if (e.which==2||e.which==3)
{
dPUW=alert(PopUpURL);
return false;
}
}
else
{
dPUW=alert(PopUpURL);
return false;
}
}
This is an example for disabling right click.
Right click on this page to test it