jeudi 13 août 2015

Button in Gridview showing UpdateProgress on Click

I have a gridview that has many columns within an UpdatePanel, 2 of those columns that are populated with buttons. There is a "Update" button outside of the gridview. When the user clicks "Update", there is a UpdateProgress div that shows up, which is expected. However, when the buttons in the gridview are clicked, it also shows up, which is not what I am intending. How can I exclude these buttons from the UpdateProgress if the gridview itself is in the UpdatePanel? I've tried ChildrenAsTriggers=False and UpdateMode=Conditional but doesn't help. See code being used below.

<asp:UpdateProgress id="UpdateProgress" runat="server">
<ProgressTemplate>
    <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
        <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/images/ajax-loader.gif" AlternateText="Updating PO, please wait ..." ToolTip="Updating PO, please wait ..." style="padding: 10px;position:fixed;top:45%;left:50%;" />
    </div>
</ProgressTemplate>
</asp:UpdateProgress>


<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="UpdateButton" EventName="Click"/>
</Triggers>

<ContentTemplate>
<!-- Gridview is here -->

</ContentTemplate>

</asp:UpdatePanel>

Example of what's in the gridview:

        <asp:TemplateField HeaderText="Button Column One">
            <HeaderStyle Width="70px" />
            <ItemStyle Wrap="False" HorizontalAlign="Center" Width="70px" />
            <ItemTemplate>
                <asp:Button ID="btnG" runat="server" OnCommand="btnG_Command" Text="View"/>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False" HeaderText="Drug Details">
            <ItemTemplate>
                <asp:Button ID="btnA" runat="server" OnCommand="btnA_Command" Text="View" />
            </ItemTemplate>
            <HeaderStyle Width="60px" HorizontalAlign="Center" />
            <ItemStyle Width="60px" HorizontalAlign="Center" />
        </asp:TemplateField>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire