Search code examples
updatepanel

update panel trigger from gridview cell


My update panel doesn't trigger when i click the button in the gridview row. Is th RowCommand the wrong trigger event? That's the code that runs on the buttonimage click.

<fieldset style="width:750px;">   
    <legend>Update Pending Registrations</legend>
        <asp:UpdatePanel ID="updtPendingUsers" runat="server">
            <ContentTemplate>
                <asp:Label ID="lblgvPending" runat="server" Visible="False"></asp:Label>
                <asp:GridView ID="gvPendingUsers" runat="server" AutoGenerateColumns="False"
                              CssClass="mGrid" DataKeyNames="userid">
                </asp:GridView>
                <asp:EntityDataSource ID="edsPendingUsers" runat="server" ConnectionString="name=enerteckEntities"
                                      DefaultContainerName="enerteckEntities" EnableFlattening="False"
                                      EntitySetName="pendingusers">
                </asp:EntityDataSource>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="gvPendingUsers" EventName="RowCommand" />
            </Triggers>       
        </asp:UpdatePanel>       
</fieldset>

Solution

  • Try setting UpdateMode="Conditional" and ChildrenAsTriggers="False" to the UpdatePanel.

    Also remove the EventName attribute form your trigger and try again.