Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable the web page?

Status
Not open for further replies.

raulgh

Programmer
Aug 20, 2003
20
SG
Dear all:

Can someone point to that is there a way to disable the mouse right click using ASP?
 
You can still go up to the menu and perform any of the operations that you could with a right-click though. So, if you really want it to be effective you'll need to open the window with no toolbars etc.

<script language=&quot;JavaScript&quot;>
function disableRightClick(e)
{
var message = &quot;Right click disabled&quot;;

if(!document.rightClickDisabled) // initialize
{
if(document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = disableRightClick;
}
else document.oncontextmenu = disableRightClick;
return document.rightClickDisabled = true;
}
if(document.layers || (document.getElementById && !document.all))
{
if (e.which==2||e.which==3)
{
alert(message);
return false;
}
}
else
{
alert(message);
return false;
}
}
</script>
 
Good thing you didn't ask that in the javascript forum. It would turn into another 45 comment thread on &quot;Why bother?&quot; here is the faq on the subject.
faq216-3337

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top