ASP.NET 2.0, testing in FF3 and IE7.
When I press the 'enter' button from the text box, the corresponding "OnClick" event is fired for the first ImageButton on the page. If I remove this image button, it fires the next ImageButton OnClick event on the page.
In the FireBug console, if I use JavaScript to submit the form, this does not happen. But for some reason, pressing input from a text field raises an unrelated ImageButton event.
I found this question that had a similar problem, however, the proposed answer to this solution does not work, since ImageButtons does not have a UseSubmitBehavior property for them.
I do not understand why this event shoots. If I look at Request.Form, I see that __EVENTTARGET is empty, and in fact it publishes all the contents of the form (all my text fields), but also includes imageButton.x and imageButton.y pairs / pairs.
Why is this? I suppose I could detect enter keystrokes from these text fields with javascript, but my experience in the past is that this behavior varies greatly between browsers. Any suggestions?
Matt source
share