views:

892

answers:

2

I know the general guidelines to double-postbacks, but this one is driving me nuts. It's a button onclick. C#. ASP.NET 2.0. And it's intermittently posting back twice when I click it in production. Can't replicate from staging, at least on the scale I've tried so far.

The code hasn't changed since before it starting doing this, as far as I can tell, and the flow of the logic certainly doesn't call for a double-dip into the click code at random times. I'm starting to dive into network traces (there are some duplicate acks and dropped segments, to be fair) and wondering if I should nuke the Temporary ASP.NET folder.

Also eyeballing this jQuery modal popup .click(function() call that returns true. Something in the back of my Javascript brain makes me suspicious.

And this interesting bug that has to do with blank img sources.

+3  A: 

I've only seen this problem pop up when a button click calls javascript that manually calls form.submit() but does not correctly cancel the click event, and thus it posts twice.

I'm not sure but I believe that if that's the case, one postback will include ButtonID=ButtonID and one will not.

Richard Szalay
Good suggestion, I'll start looking at the click code more carefully.
Chris
A: 

make sure you are not handling the even on other Events too, like Page load, Page Init