
Editorial illustration.
Originally published 16 June 2023; rewritten and reviewed on 15 October 2026.
A button click was producing duplicate work in an ASP.NET Web Forms page. The markup looked ordinary: an HTML button with runat="server", a server-click handler and type="submit". The useful clue appeared in the generated page rather than in the handler itself.
Trace the actual request paths
The browser’s native submit behaviour and generated postback behaviour were both relevant to the case described in my original post. I inspected how the page invoked __doPostBack rather than assuming the server event was somehow running spontaneously.
For that particular markup, changing the HTML button type resolved the duplicate submission:
<button runat="server" id="SaveButton"
type="button"
onserverclick="SaveButton_ServerClick">
Save
</button>
This is a historical fix for the described Web Forms control. It is not a universal rule that every submit button should become a plain button. Other controls and scripts can generate different behaviour.
Verify the network before declaring a fix
Inspect how many requests one click sends and what initiates them. Check for duplicate event subscriptions, additional JavaScript listeners and accidental repeated user actions as separate possibilities.
Then confirm the server handler and any downstream operation are invoked as expected. A page-level change should be supported by a reproducible before-and-after check, not just the disappearance of one visible duplicate.
Protect the business operation as well
A user can double-click, retry after a timeout or resubmit a request independently of this bug. Important writes, payments and notifications need an appropriate duplicate-handling strategy on the server.
What I would retain from this issue is the diagnostic sequence: inspect the rendered markup, observe the request and only then change the control. The server code may be executing twice because the browser was told to ask twice.
Related reading
Images from the original article
The following images are retained as historical context; interfaces and configuration options may have changed.
