Button should not be the default control when pressing enter

G

George Homorozeanu

Hi,

I have an ASP.Net Page with some control on it (buttons, textboxes,
calender, etc). When I'm changing the text in the textbox I want to run some
code and change the date of the calendar. The problem is that when I press
enter, the code for the button event is called. It looks like the button is
the default action for pressing enter somewhere on the page. How can I
change that? The button is an asp button.

Thanks,
George.
 
B

Brock Allen

Why don't you use an <input type=button> instead and then attach your onclick
attribute to that? You can still make it runat=server if you'd like to work
with it on the server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top