I’ve just added some JavaScript to the onclick of a Button in ASP.NET to disable the button (in order to prevent the user submitting the form twice).
When I click this button, the page posts back fine but no control event handler runs – ASP.NET seems unable to determine which control posted the page back.
I’m a bit stumped by this unexpected behaviour. Can anyone explain it and suggest an alternative way of doing this?
Try This:
It’ll come through with no extra request inspection needed.
After your comment about how you add the onclick:
Just add _doPostBack(‘_Page’, ‘YOURBUTTONNAME’) and inspect the event args on the server side.