Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2009, 03:10 AM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 2
Thanked 1 Time in 1 Post
Default ImageButton - Activation/Hot Keys

Hello,
I have a HTML image control in one of my page. On click of this it opens upa popup (Date Picker Popup). Is it possible to give one Hot Key/Activation Key so that on press of Key (s) opens up the popup.

This is very very important and any help is highly appreciated.
 
Old May 8th, 2009, 09:17 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default You can...

You can use javascript but if the client has javascript disabled this won't work but if you keep your image on click then it's kind of like a fail safe. I don't know what key you want to use but i'll use the enter/return key.

Code:
document.onkeyup = KeyPress;
function KeyPress(e)
 {
  var KeyID = (window.event) ? event.keyCode : e.keyCode;
  switch(KeyID)
   {
    case 13: 
     window.open('your popup link here');
     break;    
    case 10:
     window.open('your popup link here');
     break;
   }
 }
I have two cases here because i'm checking for the enter/return key (two different keys) You can use any keycode there you want. Hope this at least helps you and gets you going in the right direction.
__________________
Jason Hall

Follow me on Twitter @jhall2013
The Following User Says Thank You to alliancejhall For This Useful Post:
abinashpatra (May 8th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool Bar with hot keys venkatraman_gururaj General .NET 0 July 13th, 2006 09:06 AM
hot keys in C++ carl.dufresne@sita.aero C++ Programming 3 January 5th, 2006 02:28 AM
When to define primary keys and foregin keys? method SQL Server 2000 1 August 26th, 2005 09:14 AM
Hot Keys Louisa VB.NET 2002/2003 Basics 6 September 27th, 2004 09:48 AM
FAQ: Text editors and hot keys richard.york Beginning PHP 1 September 10th, 2003 06:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.