Sunday, March 20, 2011

How to add keyboard shortcuts in ASP.NET for Focus / ButtonClicks

Hi there!

How can I add some keyboard shortcuts (ctrl/alt/shift + something) to focus textboxes and/or perform button clicks?

And, ss it possible to have a Keyboard shortcut to call some method in my .cs code-behind?

Can anyone me tell me how?

From stackoverflow
  • This needs to be implemented with javascript, I would recommend jQuery. If you google jQuery hotkeys or jQuery keyboard shortcuts etc you should find alot of articles on this.

    Vitor Reis : i see... then no functions from codebehind can be called?
    Chris Marisic : You can interact with codebehind by either having the keystrokes simulate button presses or interact with any other control that causes postbacks, you can work with AJAX and call web services or you can interact with the page through `[WebMethod]` decorated page methods.


Post a Comment