Click here to Skip to main content
11,642,600 members (66,632 online)
Click here to Skip to main content

Tagged as

How to prevent textbox postback when hitting Enter key in ASP.NET

, 24 Oct 2011 CPOL 12.3K
Rate this:
Please Sign up or sign in to vote.
This seems to do the job:

This seems to do the job:

<asp:textbox id="tbTest1" runat="server" onkeypress="return event.keyCode != 13;" />

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Steverey42
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralReason for my vote of 5 Short & simple Pin
thatraja26-Oct-11 3:34
mvpthatraja26-Oct-11 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150731.1 | Last Updated 24 Oct 2011
Article Copyright 2011 by Steverey42
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid