protected void AddButton_Click1(object sender, EventArgs e) { if (NameTextBox.Text == "") { Label1.Text = "Please Enter Name"; } else { AddNotificationRepository addNotificationRepository = new AddNotificationRepository(); int Eid; Eid = addNotificationRepository.InsertEvent(NameTextBox.Text, Convert.ToInt32(SourceDropList.SelectedValue), ConfidentialEventCheckBox.Checked, MandetoryEventCheckBox.Checked); for (int Count = 0; Count < 4; Count++) { if (ChannelCheckBoxList.Items[Count].Selected) { addNotificationRepository.InsertEventChannel(Eid, Convert.ToInt32(ChannelCheckBoxList.Items[Count].Value)); } } Response.Redirect("Notifications.aspx"); } }