tags:

views:

27

answers:

1

it's a simple question and yet i couldn't figure how this works. I created an aspx page without any master page. Put one text box on the form. then use Internet Explorer 8 and visit that page. typed something and hit ENTER on the keyboard. The form submits (judging by that page being refreshed). I didn't even put any buttons on the form. Just the textbox. What triggers the postback?

I further added one < asp:Button > next to the textbox and wired the button to see if it's been clicked. i repeat the same thing, typed something in the textbox and hit ENTER on the keyboard. The form submitted but the button wasn't click. What's happening? How the postback is triggered if it's not from the button?

This is happening in Mozila Firefox too except that when i added a button on the page, the button will be hit when ENTER on the keyboard is pressed.

Can anyone shed some light as to why the button i added didn't respond to the ENTER on the keyboard in IE8?

Thank you.

A: 

IE8 wants you to assign the postback to a button.

You can assign the <form> a default button, or you can wrap the textbox and button in an <asp:Panel> and assign the panel a default button.

Louis
Thanks, never knew there's a default button property. All these while I thought the first submit button on the form is always the default button.
Twisted Whisper