Call a js function on
OnClientClick event of button.
e.g.
if the button in gridview is like,
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ImageButton3" runat="server" CommandName="Delete" Height="12px"
ImageUrl="~/images/delete.png" ToolTip="Delete Record" Width="12px" OnClientClick="return delrecord();" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" Wrap="False" Width="30px" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" Width="30px" />
</asp:TemplateField>
as you can see js function delrecord() is called which is like,
function delrecord() {
if (confirm("Are you sure want to Delete Record ?")) {
return true;
}
else {
return false;
}
}