private void grd_ItemDataBound(object sender,System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.FindControl("Delete") != null)
{
((LinkButton) e.Item.FindControl("Delete")).Attributes.Add("onClick", "return confirm('Are you sure to delete this item?');");;
}
}
findcontrol() method searches the current naming container for a server control with the specified id parameter.using the findcontrol we find the delete link button and give the confirmation box using javascript when the button in the grid is clicked.
CONFIRMATION OF DELETE BUTTON IN GRID
Posted by
Geeks
Labels:
Asp.net,
Javascript
Subscribe to:
Post Comments (Atom)
Post a Comment