This is a code to hide right click on any web page and to hide inspect element and page source of page. I have used JavaScript to hide a source code below is the code. It blocks Ctrl + U , Right click , F12 , and Ctrl+ Shift + J Step One : copy JavaScript and paste under head tag. <script> document.onkeydown = function(e) { if(event.keyCode == 123) { return false; } if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){ return false; } if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){ return false; } if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){ return false; } } </script> Step Two : Put this code in the body tag. <body oncontextmenu="return false;"> Now you can run your page and check using all the short controls and right click all are disabled now… Happy Coding Day
1) In location path add your old url 2) Then in httpRedirect add your new url 3) In global.asax add new url to redirect on old page. There is page activities/scuba-diving.aspx now i want new url that is activities/best-rated-scuba-diving-in-goa.aspx there is no page by this name , i will redirect my old url to new url but page will be same activities/scuba-diving.aspx. <configuration> <location path="activities/scuba-diving.aspx"> <system.webServer> <httpRedirect enabled="true" destination="https://www.domain.com/activities/best-rated-scuba-diving-in-goa.aspx" httpResponseStatus="Permanent" /> </system.webServer> </location> </configuration> Now add following code in global.asax. static void RegisterRoutes(RouteCollection routes) { routes.MapPageRoute("DynamicPagescuba", "activities/best-rated-scuba-divin...
Comments
Post a Comment