Disable Enter Button ASP.Net

Posted on 2010-09-11
Medium Priority
Last Modified: 2012-05-10
Hi There

I have two forms on a page each form has its own asp:imagebutton and validation group.
When the user clicks enter on the keyboard it posts the first form.

How do I disable pressing enter on the keyboard and force them to use the form buttons.
Question by:Stanton_Roux
LVL 12

Expert Comment

ID: 33652556
I think this article handles what you need.:


I used it in a similar way before.

Expert Comment

ID: 33653385

hope this helps, if not pls let me know!

Accepted Solution

abhinayp86 earned 2000 total points
ID: 33662433
a Form or an asp:panel has an attribute called DefaultButton. On on enter hit, the default button is triggered



To force ppl to click button, set the default button to some textbox or a label.


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question