HighTechTalks DotNet Forums  

On Key Press

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss On Key Press in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mike Moore
 
Posts: n/a

Default On Key Press - 11-01-2005 , 11:01 AM






We are using the "onkeypress" event in Javascript to determine when
the user hits a particular key. This works well unless an ASP.NET
control (such as a textbox) has focus. In this case the onkeypress
event does not fire. Unfortunately, our need is to handle key presses
when a control does have focus, so we are kind of stuck right now.

My question is are we approaching this in the correct way? Is there
a better way to do this?


Reply With Quote
  #2  
Old   
.net noobie
 
Posts: n/a

Default RE: On Key Press - 11-11-2005 , 06:41 PM






i think u will need to add a javascript call to the asp.net control

e.g. onclick="return myJsMethod();"

in the myJsMethod();

u need to return "false" if u do not want to do a asp.net postback
and "true" if u do want to postback to occur.

"Mike Moore" wrote:

Quote:
We are using the "onkeypress" event in Javascript to determine when
the user hits a particular key. This works well unless an ASP.NET
control (such as a textbox) has focus. In this case the onkeypress
event does not fire. Unfortunately, our need is to handle key presses
when a control does have focus, so we are kind of stuck right now.

My question is are we approaching this in the correct way? Is there
a better way to do this?


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.