protected void btnEnviarMsgGrupo_Click(object sender, EventArgs e) { DataTable tblAlumno = ejecAlum.ObtenerIDGrupo(Convert.ToInt32(ddlGrupo.SelectedValue)); foreach (DataRow rowa in tblAlumno.Rows) { datoMsg.IDRemitente = Convert.ToInt32(Session["IDUserLoged"]); datoMsg.IDDestinatario = Convert.ToInt32(rowa.ItemArray.GetValue(0)); datoMsg.Asunto = txtAsuntoGrupo.Text; datoMsg.Mensaje = txtMensajeGrupo.Text; ejecMsg.agregarMensaje(datoMsg); } ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert();", true); }