public void SaveDropInData() { // go throught the grid view rows for (int i = 0; i < gvDropIn.Rows.Count; i++) { // find our hidden fields for old values string strID = ((Label)gvDropIn.Rows[i].FindControl("lblID")).Text; string strDropInRateNew = ((TextBox)gvDropIn.Rows[i].FindControl("txtDropInRate")).Text; string strDropInRateOld = ((Label)gvDropIn.Rows[i].FindControl("lblOldDropInRate")).Text; if (strDropInRateNew != strDropInRateOld) { // if any changed, save the rate string message = bi.UpdateDropInRates(strID, strDropInRateNew, Session["EditLabKitID"].ToString()); Log.Info(Context.User.Identity.Name, Request.FilePath, Session, "Edited Drop In Rate", "LabKit:" + Session["EditLabKitID"].ToString() + ",ID:" + strID + ",OldValue:" + strDropInRateOld + ",NewValue:" + strDropInRateNew); } } // refresh our grid PopulateDropInGrid(); }