I have a gridview and I have a button on it.I want, if the user click on a button on a row,this row will be delted.I did this steps but I have no success.could you please help me to solve my problem?
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int k=int.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString());
Label1.Text = k.ToString();
}
I wanted to see the value in a lable but no success( I think this event doesn’t fire)
Edited:
I like to specify my handlers in code-behind in Page_Init event, so it looks like this: