This is nice for non standard buttons (like a CTRL + s), but OK and Cancel buttons have standard implementations in a Windows Form. Look for the properties
of a Windows Form (not sure if this applies in ASP.NET or WPF, I need confirmation on that). There you can specify a button to serve as a accept or cancel event. They will automatically be executed when the Enter and Esc keys are pressed and the form has focus.
AcceptButton = btnOk;
CancelButton = btnCancel;