Capture Enter Key in ASP.NET’s Textbox

Here is some sample code on how to capture the enter key on a textbox in ASP.NET. I am posting this because I use it a lot.

function KeyDownHandler() {
if (event.keyCode == 13) {
event.returnValue = false;
event.cancel = true;

Then add this to your textobox:

Categories: SharePoint or Custom Development | 1 Comment

Post navigation

One thought on “Capture Enter Key in ASP.NET’s Textbox

  1. Wow, I’ve definitely learned the techniques in this comprehensive tutorial.
    Thank you for sharing this information.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: