views:

698

answers:

3

I'm using ASP.NET and I have a save button on webform. When that save button is clicked (ONCE) and I'm using IE8 the event handler is executed twice. If I use compatibility mode it works just fine. In FF everything works just fine. I tested IE8 on both Vista and windows 7 and get the same behavior. IE7 works just fine. Just curious is anyone has had a similar issue.

P.S. I am using an advanced layout system which positions and styles the controls based on a layout definition, so it isn't just a standard throw controls on a page setup.

A: 

I just fixed a bug with similar symptoms which was caused by two form.submit() calls being made in the client-side javascript event handler for the button.

It appears the second form.submit() was being ignored by other browers but executed in IE8.

tarn
A: 

We are using onserverclick on a button tag instead of using an asp.net button. The solution was to set the type of the button to "button". Before no type was set and I think it was defaulting to submit.

Changed

<button id="button1" runat="server" onserverclick="button1_OnClick" />

To

<button id="button1" runat="server" type="button" onserverclick="button1_OnClick" />

Now I do not get the double post back in IE8.

Randall Sutton
A: 

i was using jquery(formobj).trigger(submit) this was changed to jquery(formobj)[0].submit()

note i am calling submit directly on the form instead of the jquery method hope this helps someone

Ambrish