How to attach confirmation message box to Gridview button
protected void gvwCategories_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton btn = e.Row.Cells[4].Controls[0] as ImageButton;
btn.OnClientClick = "if (confirm('Are you sure you want to delete this category?') == false) return false;";
}
}