Monday 16 July 2018

Disable Mouse Right Click, F12 and Ctrl+Shift+I, redirect to login page using jquery

////////////////////
http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js

////////////////////

<script type="text/javascript">
                    $(document).ready(function () {
                        $(document)[0].oncontextmenu = function () { return false; }
                        $(document).mousedown(function (e) {
                            if (e.button == 2) {
                                alert('Sorry, This functionality is not enable!');
                                window.location.href = "Default.aspx";
                                return false;
                            } else {
                                return true;
                            }
                        });
                    });
                    $(document).keydown(function (event) {
                        if (event.keyCode == 123) { // Prevent F12
                            alert('Sorry, This functionality is not enable!');
                            window.location.href = "Default.aspx";
                            return false;
                        } else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { // Prevent Ctrl+Shift+I  
                            alert('Sorry, This functionality is not enable!');
                            window.location.href = "Default.aspx";
                            return false;
                        }
                    });

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...