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;";
   }
}

posted @ 2007-11-21 08:36  Vincent Yang  阅读(338)  评论(0编辑  收藏  举报