Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

preventing multiple clicks on image buttons inside a gridview in an update panel

$
0
0

I have posted this in Web Forms Data Controls section, but it wasn't solved. And since this is related to partial postbacks, I am requesting here.

I appreciate if someone can please help me with, preventing multiple clicks on image button that is in template field in a gridview that is inside an update panel. Do I need to add some code to any of the methods like add_initializeRequest, add_beginRequest?

I have an update panel.

<asp:UpdatePanelID="UpdatePanel1"runat="server">

In this update panel I have a gridview. 

<asp:GridViewID="GridView1"AutoGenerateColumns="False"Width="100%"runat="server"GridLines="None"OnRowDataBound="GridView1_RowDataBound"OnRowCommand="GridView1_RowCommand">

In this gridview I have a Templatefield with Image button.

<asp:TemplateFieldHeaderText=""><ItemTemplate><asp:ImageButtonID="btnDelete"runat="server"CausesValidation="False"CommandName="DeleteSomething"ImageUrl="delete.png"/></ItemTemplate></asp:TemplateField>

The update panel has trigger.

<asp:AsyncPostBackTriggerControlID="GridView1"/>

So when page loads and data is loaded in grid view, there will be one image button for each row. And on each of these buttons I need to prevent multiple clicks. If btnDelete on Row2 is clicked it should delete the row2, and while the server is still processing the row deletion, it should prevent the user from clicking that button on row2 again. Or in other words clicking the same image button multiple times should not cause multiple partial postbacks.

thank you in advance


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>