hi
Update:
--------------
ID of label control that holds SNO is... "lblSno"
So change the code from...
int Sno = Convert.ToInt32((GridView1.Rows[e.RowIndex].FindControl("SNO") as Label).Text);
to
int Sno = Convert.ToInt32((GridView1.Rows[e.RowIndex].FindControl("lblSno") as Label).Text);
better code will be..
int Sno = 0 ;
Label lblSno = GridView1.Rows[e.RowIndex].FindControl("lblSno") as Label
if (lblSno != null)
{
int.TryParse(lblSno.Text, out Sno);
}
This way you can prevent error.
For Delete
---------------------
I think your cell index (i.e
Cells[0]
) is not right. plesae check the following line
Hope this will help you
string favoritesId = GridView1.Rows[e.RowIndex].Cells[0].Text;