views:

629

answers:

1

Here is the code:

<asp:GridView ID="MyGridView" runat="server">
    <Columns>
        <asp:BoundField Text="Name" DataField="Name" />
        <asp:TemplateField HeaderText="Delete">
            <ItemTemplate>
                <asp:ImageButton ID="DeleteButton" runat="server" ImageUrl="~/images/delete.png" CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>' />
                <ajax:ConfirmButtonExtender ID="DeleteCbe" runat="server" TargetControlID="DeleteButton"  ConfirmText="Continue with delete?" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

i want to disable DeleteButton when "Ok" is clicked. this will prevent the user from clicking the image several times while it is still deleting the data in the db. is this possible? how do i do it? thanks.

+1  A: 

I have a script on my blog that will disable all the buttons on the form once a postback begins. This way, they will not be able to trigger any other postback until that one completes.

How to Disable the Submit Button of a Web Form

This solution is very easy to integrate into your app.

Josh Stodola
thanks josh. i'll go to your blog and i'll try to use script in my codes.
ban-G