protected void Mark_Absent(object sender, CommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); string course_id = Request.QueryString["val1"]; string sectionid = Request.QueryString["val2"]; // Retrieve the row that contains the button // from the Rows collection. GridViewRow row = Students.Rows[index]; string roll_no = row.Cells[0].Text; objBL.Mark_Absent(roll_no, course_id, sectionid); // Add code here to add the item to the shopping cart. }