What would cause an asp Button not to fire after a partial update has occured?
<asp:UpdatePanel ID="upPan" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Button ID="btnSave" ClientIDMode="Static" runat="Server" Text="Save" CausesValidation="false" /> </ContentTemplate> </asp:UpdatePanel>
- The first time any button is fired inside the update panel the below routines fire in this order.
- After a postback has occured triggering the button again causes a postback, both
PreRenderCompleteevents fire but the click event is skipped.
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.PageLoad //Runs everytime End Sub Protected Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click //Doesn't fire after first postback. End Sub Protected Sub Page_PreRenderComplete(sender As Object, e As EventArgs) Handles Me.PreRenderComplete //Runs everytime End Sub
Suggestions to resolve this include:
This is already the default behaviour of UpdatePanel and offers no change.
<asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
Again by default child controls of the panel cause an asynchronous postback and declaring triggers is redundant.
If I simply change the
asp:Button into an
asp:LinkButton the issue is resolved.
The postback is occuring but the click event is being missed when the sender is an asp:Button control.
Can anyone explain what would cause this behaviour?