On grid RowDataBound based on some condition i've added imagebutton dynamically. parallelly i want to add event for this button click. here is my code snippet
 
Code
protected void GV3_RowDataBound(object sender, GridViewRowEventArgs e)
Code
{
Code
if (e.Row.RowType == DataControlRowType.DataRow)
Code
{
Code
TableCell cell = new TableCell();
Code
ImageButton bttn = new ImageButton();
Code
bttn.CommandName = "Delete";
Code
bttn.ImageUrl = "delete.png";
Code
bttn.ToolTip = "Click to delete this record";
Code
bttn.CommandArgument = e.Row.Cells[0].Text;
Code
cell.Controls.Add(bttn);
Code
e.Row.Cells.Add(cell);
Code
bttn.OnClientClick = "return confirm('Are you sure you to delete " + e.Row.Cells[0].Text + "?');";
Code
}
Code
}
 That message popup box comes, but i'm unable to catch that click event. while click on a row i want to delete that row, so want to create event dynamically. for that i've used this following dynamic click event
 
Code
bttn.Click += new ImageClickEventHandler(b_Click);
Code
private void b_Click(object sender, EventArgs e)
Code
{ //delete record
Code
}
 but this above code also not working. Please help me to solve this. Thanks in advance.