Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

prevent Textbox postback when hit enter key?

3 views
Skip to first unread message

pedestrian via DotNetMonster.com

unread,
Feb 18, 2010, 3:50:51 AM2/18/10
to
I create a asp.net 3.5 page using visual studio 2008. It is a simple page
with labels, text boxes and a few buttons. The problem is when I hit enter
key on the textbox the page is post back. I would like to prevent this, what
should I do?

In addition, I particularly week in designing user interface for web pages.
Any books to brush up on this?

Thanks for replying...

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/201002/1

Nathan Sokalski

unread,
Feb 25, 2010, 10:33:46 PM2/25/10
to
First of all, when you say you want to prevent the enter key from doing a
postback, does that mean you want the user to only be able to use a button
to postback, or does it mean you want the form to pass validation before it
is submitted? I would suggest you learn how to use ASP.NET Validators
(assuming you don't know how to use them already, they are pretty simple to
use).
--
Nathan Sokalski
njsok...@hotmail.com
http://www.nathansokalski.com/

"pedestrian via DotNetMonster.com" <u16758@uwe> wrote in message
news:a3cf1af85270a@uwe...

0 new messages