R
Robert Dickow
I have some ASP.NET Web App pages on which there are web forms with
textboxes and buttons for 'Cancel' and 'Submit' and such. All works great.
However, it a user uses the ENTER key in either of two textboxes, the
postback 'falls through' to one of the 'Cancel' button handlers, and exits
the application. Oddly, I can't use anything in the Cancel routine to check
whether the ENTER key was hit, since the sender object is always the Cancel
key itself. This behavior is unwanted, and I can't figure out how to trap
the ENTER hey strokes either on the client or server side.
On some pages I have been able to get the ENTER key to fall through to a
Submit button, which makes more sense, but I still would like to be able to
process the postback depending on the ENTER key usage or not.
What approach should I be using?
Bob
textboxes and buttons for 'Cancel' and 'Submit' and such. All works great.
However, it a user uses the ENTER key in either of two textboxes, the
postback 'falls through' to one of the 'Cancel' button handlers, and exits
the application. Oddly, I can't use anything in the Cancel routine to check
whether the ENTER key was hit, since the sender object is always the Cancel
key itself. This behavior is unwanted, and I can't figure out how to trap
the ENTER hey strokes either on the client or server side.
On some pages I have been able to get the ENTER key to fall through to a
Submit button, which makes more sense, but I still would like to be able to
process the postback depending on the ENTER key usage or not.
What approach should I be using?
Bob