it's all about sharing experiences in development with .net.
Sunday, February 18, 2007
Enter key Navigation and asp.net 2.0
there are two ways of getting to navigate with the enter key. one is using the panel control's property
another method, is to use the onkeydown event of the body element to detect the enter key
here's the function that would detect the enter key:
>> body onkeydown='ManageKeyDown'
if(window.event) // for IE
else if(e.which) // for Netscape/Firefox/Opera
if (code== 13) // if it's the enter key
//here goes the implentation necessary to execute a button
this is another way, which is a bit more flexible, and works with ajax. while the defaultButton property of a panel may not work with the update panel (from my experience with this technique).
Post a Comment
Post Comments (Atom)