0

I created a logo quiz in Asp.net. What I want is when the user fills the quiz he should not be able to right click and select on 'Search Google for image'.

Earlier I thought of using an alert using JavaScript but that can be disabled in the browser. Need a permanent solution for this. Thanks in advance.

bsk
  • 11
  • 1
  • 5

2 Answers2

1

You could cancel the right-click event on the image. It would of course only work with JavaScript enabled, but there is no way of disabling that option altogether.

Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
1

I know this is an old post, but, in case anyone else is trying to resolve the issue.

You can certainly disable the context menu in javascript, you can also render the image underneath a transparent object any attempts to click, or context menu the image would result in the click or context menu of the transparent image being triggered.

You could also add your image in css as a background image to a regular html element.

The context menu won't show up for it, but, inspect image will show a clickable link in the css attributes that anyone knowing a little web development will know about.

The best answer is a combination of the css and the transparent overlay.

Dwight Wilbanks
  • 131
  • 1
  • 6