C# – capturing the enter key on textbox in asp.net for windows ce


I want to capture the enter key on text for windows ce msie6.0 but there is no button for that so i cannot use default button property for the form tag itself. What else i can do to capture the Enter key?


Best Solution

I have used this function javascript in IE6, not sure if it will work in Windows CE

    <script language="javascript">
    document.onkeydown = myOnkeydown;  
    function myOnkeydown()
        var key = window.event.keyCode;
        if (key == 13) { //13 is the keycode of the 'Enter' key
           //do stuff

Edit: This function captures the input in all fields. You can plug it to the textbox of your choice if you like.