Hi sambath,
When the Update Button is clicked, the GridView's OnRowUpdating event handler is triggered.
Id which is the primary key is fetched from the DataKey property of GridView while the Name and mobile fields are fetched from their respective TextBoxes. For this you need to use GridViewRow's FindControl method to find the controls ie in the EditItemTemplate.
sambath says:
int
id = Int32.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString());
string
Name = (GridView1.Rows[e.RowIndex].Cells[3].Controls[0]
as
TextBox).Text;
string
mobile = (GridView1.Rows[e.RowIndex].Cells[4].Controls[0]
as
TextBox).Text;
load.UpdateMember(id, Name, mobile);
C#
GridViewRow row = GridView1.Rows[e.RowIndex];
int id = Int32.Parse(GridView1.DataKeys[e.RowIndex].Values[0]);
string name = (row.FindControl("txtName") as TextBox).Text;
string mobile = (row.FindControl("txtMobile") as TextBox).Text;
load.UpdateMember(id, name, mobile);
For more details refer below article to find controls in GridViewRow.