Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1253
Confirm delete on ImageButton
posted

Hello,

I'm using Version 11.2 and have a WebDataGrid with a TemplateDataField where I created an ImageButton in the ItemTemplage - see code below

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="False"
Height="347px" Width="578px" DataKeyFields="Id" >
<Columns>
<ig:TemplateDataField Key="TemplateField_0">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ToolTip="Handles Click Event of the ImageButton" />
</ItemTemplate>
<Header Text="TemplateField_0" />
</ig:TemplateDataField>
<ig:BoundDataField DataFieldName="Id" Key="OrderId"
Header-Text="Order No" >
<Header Text="Order No" />
<ig:BoundDataField DataFieldName="username" Key="UserName"
Header-Text="User Name" >
<Header Text="User Name" />
</ig:BoundDataField>
</Columns>
</ig:WebDataGrid>

When the user click on the imagebutton - to delete a record - I need to confirm it before the delete process occurs.  i know how to display the confirm alert using Javascript.  The only question I have is how to call the C# code behind when the user clicks Ok to actually delete the record.  Can anyone help me on this?  Thanks!