This is delete confirmation in Gridview

Introduction
This is simple to create Delete Confirmation Message.
1.Write following Code in Your WebPage for test this.
<
asp:GridView
id="grdEmployees"
DataSourceId="srcEmployees"
DataKeyNames="Id"
AllowPaging="true"
AutoGenerateColumns="false"
GridLines="both"
Runat="server" OnRowCreated="grdEmployees_RowCreated">
<Columns>
<asp:CommandField ShowDeleteButton="true" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
</Columns>
</asp:GridView>
<asp:SqlDataSource
id="srcEmployees"
ConnectionString="Data Source=.\SQLExpress;
AttachDbFilename=|DataDirectory|Table.mdf;
Integrated Security=True;User Instance=True"
SelectCommand="SELECT * FROM Employees"
DeleteCommand="DELETE Employees WHERE Id=@Id"
Runat="server" />
2.Write following Code on Gridviews RowCreated Event
protected
void grdEmployees_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkDelete = (LinkButton)e.Row.Cells[0].Controls[0];
lnkDelete.Attributes[
"onclick"] = "return confirm('Delete Record?')";
}
}