Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to create some shortcuts to my application.

Example: While running my application if i click ctrl+H it should open Home page,
similarly if i click ctrl+H it should redirect to another page etc.,

any suggestions and help is great.

I don't have any idea about this..
Do let me know if you have any links or materials from where i can get some help...

Thanks in Advance

Anupama Bommaraju
Posted

The AccessKey property is available for all controls derived from WebControl like Button[^]
WebControl.AccessKey[^]

Some more info here:
http://en.wikipedia.org/wiki/Access_key[^]

Regards
Espen Harlinn
 
Share this answer
 
v2
Comments
Nish Nishant 12-Apr-11 17:46pm    
Voted 5, proposed as answer!
Espen Harlinn 12-Apr-11 17:50pm    
Thank you, Nishant!
Monjurul Habib 12-Apr-11 17:50pm    
better than my answer. my 5+
Espen Harlinn 12-Apr-11 18:10pm    
Thanks Monjurul!
Sergey Alexandrovich Kryukov 12-Apr-11 18:02pm    
All correct, my 5.
--SA
http://forums.asp.net/t/1552843.aspx/1[^]

I hope the above information will be helpful. If you have more concerns, please let me know.
 
Share this answer
 
Comments
Espen Harlinn 12-Apr-11 17:47pm    
Your link indirectly leads to http://en.wikipedia.org/wiki/Access_key through other pages that have to be manually copied and pasted into the browser address bar. So in an indirect way this could be considered an answer, although a bit convoluted. I updated my own answer to include the direct link - so you'll have my 5!
Monjurul Habib 12-Apr-11 17:50pm    
thank you.
Sergey Alexandrovich Kryukov 12-Apr-11 18:03pm    
I agree with Espen; and nevertheless it does deserve a 5.
--SA
Monjurul Habib 12-Apr-11 18:07pm    
thank you.
 
Share this answer
 
XML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>Untitled Page</title>
  <script type="text/javascript">
  document.attachEvent('onkeyup', KeysShortcut);

// Now we need to implement the KeysShortcut
function KeysShortcut ()
{
    if (event.keyCode == 49)
    {
      document.getElementById('<%= button1.ClientID %>').click();
    }
}
  </script>
</head>
<body>
   <form id="form1" runat="server">
   <div>
   <asp:ScriptManager ID="a" runat="server"></asp:ScriptManager>
   </div>
  <div id="target" style="background-color: gray">This is a simple div</div>
    <asp:Button ID="button1" runat="server" />
   </form>
</body>

</html>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900