How to write a code for disabling view source from mouse right click and choose menu item in menu?
in my asp.net page.
Please give me a code.
Every browser has its built-in functionality to view the source code or the webpage. We can do one thing. That is disabling right click in your page.
For disable right click use the following code:
document.onselectstart=new Function ("return false")
Remember one thing. We can view this source using firebug or some other third party tools. So we cant do this 100%.
13 Mar '12 - 22:47
As mentioned by Shivapragasam, it's not worth doing this - you can always use web developer tools such as firebug to view everything you want about a page.
All you're going to achieve by disabling right mouse is annoying anyone using your pages, in case they want to use some context menu items.
13 Mar '12 - 22:58
Besides diabling right click ,if you want to stop users from using menu item ,
use a popup frame. There you are unable to use menu item....
13 Mar '12 - 23:12
You can develop your website using Silverlight.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)