protected void SendForInterviewButton_Click(object sender, EventArgs e) { List<String> idList = new List<String>(); CheckBox cb = new CheckBox(); foreach (GridViewRow row in ApplicantsListGridView.Rows) { cb = (CheckBox)row.Cells[selectRow].Controls[0]; if (cb.Checked) { idList.Add(((GridViewRow)cb.NamingContainer).Cells[0].Text); } } EmailModule myEmailModule = new EmailModule(); Employer emailSender = new Employer(); emailSender.sheduleAndCallForInterviews(idList, Request["pid"], StartingTimeTextBox.Text, DateTextBox.Text, VenueTextBox.Text); /* foreach (String applicantId in idList) { myEmailModule.sendEmailForInterview(applicantId, Request["pid"], "10.30AM", "06/06/2015", "Company Conference Hall"); } */ }