Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to disable CTRL + N Key in a keyboard.?

How to disable CTRL + N Key in a keyboard.?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
7 Posts 3 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Balagurunathan S
    wrote on last edited by
    #1

    Dear Friends.. I am having an .aspx application.I need to restrict the CTRL + N key inorder to prevent the opening of my web page a new window..Some one help me with the code.. Thanks & Regards,

    Balaguru

    N V 2 Replies Last reply
    0
    • B Balagurunathan S

      Dear Friends.. I am having an .aspx application.I need to restrict the CTRL + N key inorder to prevent the opening of my web page a new window..Some one help me with the code.. Thanks & Regards,

      Balaguru

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Balagurunathan S wrote:

      I need to restrict the CTRL + N key inorder to prevent the opening of my web page a new window

      It's bad idea to block the keys. You might be able to do this with JS, but it's not reliable. Why you need to block users opening pages in new window ?

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      V 1 Reply Last reply
      0
      • N N a v a n e e t h

        Balagurunathan S wrote:

        I need to restrict the CTRL + N key inorder to prevent the opening of my web page a new window

        It's bad idea to block the keys. You might be able to do this with JS, but it's not reliable. Why you need to block users opening pages in new window ?

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        N a v a n e e t h wrote:

        It's bad idea to block the keys.

        I admit.

        N a v a n e e t h wrote:

        Why you need to block users opening pages in new window ?

        Some of the financial applications expect this sort of weird behavior.You need to have yeoman patience and skillset to convince those dumb managers.

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        N 1 Reply Last reply
        0
        • B Balagurunathan S

          Dear Friends.. I am having an .aspx application.I need to restrict the CTRL + N key inorder to prevent the opening of my web page a new window..Some one help me with the code.. Thanks & Regards,

          Balaguru

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          You may need to entrap the keycode for CTRL+N in keydown event and NULL it.

          Vasudevan Deepak Kumar Personal Homepage
          Tech Gossips
          A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

          B 1 Reply Last reply
          0
          • V Vasudevan Deepak Kumar

            N a v a n e e t h wrote:

            It's bad idea to block the keys.

            I admit.

            N a v a n e e t h wrote:

            Why you need to block users opening pages in new window ?

            Some of the financial applications expect this sort of weird behavior.You need to have yeoman patience and skillset to convince those dumb managers.

            Vasudevan Deepak Kumar Personal Homepage
            Tech Gossips
            A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            Vasudevan Deepak K wrote:

            Some of the financial applications expect this sort of weird behavior.You need to have yeoman patience and skillset to convince those dumb managers.

            Yes. But a better approach would be the following. 1 - When user opens the page, we set a flag in DB 2 - Page load, this flag is checked to ensure only one page is running. 3 - When user finishes the operation, reset the flag. 4 - A scheduled job should run frequently which checks the flag value and the time it has started. if it is more than timeout limit, reset the flag. What do you think ?

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            1 Reply Last reply
            0
            • V Vasudevan Deepak Kumar

              You may need to entrap the keycode for CTRL+N in keydown event and NULL it.

              Vasudevan Deepak Kumar Personal Homepage
              Tech Gossips
              A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

              B Offline
              B Offline
              Balagurunathan S
              wrote on last edited by
              #6

              Dear Deepak.. How to Do that..Can u help me with the code.. Regards,

              Balaguru

              V 1 Reply Last reply
              0
              • B Balagurunathan S

                Dear Deepak.. How to Do that..Can u help me with the code.. Regards,

                Balaguru

                V Offline
                V Offline
                Vasudevan Deepak Kumar
                wrote on last edited by
                #7

                http://www.arraystudio.com/as-workshop/disable-ctrl-n-and-other-ctrl-key-combinations-in-javascript.html[^]

                Vasudevan Deepak Kumar Personal Homepage
                Tech Gossips
                A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups