Edit and Delete in same column

Posted by Oswaldlily under ASP.NET on 3/19/2013 | Points: 10 | Views : 750 | Status : [Member] | Replies : 1
<asp:CommandField ButtonType="Button" ShowEditButton="True" runat="server" ShowDeleteButton="true"><ItemStyle />

In this case (Edit and Delete in same column)..
I need Confirmation message "Are u sure u wan to delete it" while i go for Delete button..
Is it possible


Posted by: Somu475 on: 3/19/2013 [Member] Starter | Points: 25


Instead of using CommandField you can use TemplateField to achieve your need.

<asp:TemplateField HeaderText="Edit/Delete">

<asp:Button ID="editButton" runat="server" CommandName="Edit" Text="Edit" />
<asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Delete"
OnClientClick="return confirm('Are you sure you want to delete it?');" />


Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response