ASP.NET Click() event doesn’t fire on second postback


I have a ASP.NET web form. The first time I submit the form, the SubmitButton_Click event is raised.

The form is returned to the browser either with validation errors or with the option to submit the form again with new values.

When the form is sumbitted again, the SubmitButton_Click event never fires. Page_Load fires, but not the button.

Does anyone know why I would be seeing this behavior on the server side?

(I am using jQuery and the validation control client-side but I don't think it is causing an issue. Thought I would mention it anyway).


<asp:Button ID="SubmitButton" OnClick="SubmitButton_Click"
      runat="server" />

Event is set on the control, not in code.

Best Solution

This can happen with dynamically created controls, if you don't create them early enough in the page life cycle. You're a bit short on details, but is your button created dynamically?

Related Question