April 26, 2011

Give confirmation on delete button in GridView in ASP.Net

<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="lbIExDelate" runat="server" Text="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?');"
CommandName="Delete"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Wrap="False" />
</asp:TemplateField>

No comments:

Post a Comment