locked
Redirect welcome.aspx if ctrl+a RRS feed

  • Question

  • User-807418713 posted

    Hello

    If i press in my aspx page ctrl+a then it should open welcome.aspx

    Thanking You

    Thursday, December 26, 2019 4:53 PM

Answers

  • User288213138 posted

    Hi Gopi.MCA,

    If i press in my aspx page ctrl+a then it should open welcome.aspx

    You can use keydown event to achieve “crtl+a”, then use the window.location.replace() function to redirect a new page.

    Ascll code of key a is equal to 65.

    The code:

    <script>
            $(document).on("keydown", function (e) {
                if (e.ctrlKey && e.which == 65)
                    window.location.replace("https://forums.asp.net/t/2162723.aspx");
            });
        </script>

    Best regards,

    Sam

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 27, 2019 2:05 AM