title: How to disable right click on IFRAME
body: <p>I have a document content displayed on IFrame in MVC web application. The content should not be copied and printed . I tried to disable right click using two functions style="pointer-events:none;" oncontextmenu="return false" for Iframe, which is working fine.
  But on right click, the pop up with 'View Frame Source', 'View Source' are displaying. How can I restrict this.!
  Also, how to restrict the print screen option. I know there are other utilities from where anybody can capture data. But the client wants to restrict the print screen option.</p>
  
  <p>    </p>
  
  <pre><code>&lt;script lang=JavaScript&gt;
      function clickIE() {
          if (document.all) {
              return false;
          }
      }
      function clickNS(e) {
          if (document.layers || (document.getElementById &amp;&amp; !document.all)) {
              if (e.which == 2 || e.which == 3) {
                  return false;
              }
          }
      }
      if (document.layers) {
          document.captureEvents(Event.MOUSEDOWN);
          document.onmousedown = clickNS;`enter code here`
      }
      else {
          document.onmouseup = clickNS;
          document.oncontextmenu = clickIE;
      }
      document.oncontextmenu = new Function("return false")
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;body   oncontextmenu="return false" onkeydown="if ((arguments[0] || window.event).ctrlKey) return false" &gt;
  &lt;div  id="div1" style="background-color:Red; height:120px"&gt;
  
  
    &lt;iframe id="id1" src="" name="I1" scrolling="no" height="100%" width="100%" marginwidth ="0" marginheight="0" onload="disableContextMenu();" style="pointer-events:none;"  /&gt; 
  
  
  
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please Any help appreciated.. !!</p>