private void btnGuardar_Click(object sender, System.EventArgs e) { i = 1; squishyTREE.TreeNode nodo = this.tvwMain.FindTreeNode("n1"); while (nodo != null) { // si esta seleccionado, lo agrego if (nodo.IsChecked) { //opciones.Add(nodo.Text); opciones.Add(nodo.Text, nodo.Text); obtenerHijosV2(nodo); } nodo = nodo.NextSibling(); } IPerfil perfil = PerfilFactory.GetPerfil(); perfil.PerfilID = Utiles.Validaciones.obtieneEntero(this.txtPerfilID.Text); try { perfil.AsignarOpciones(new ArrayList(opciones.Values)); Page.RegisterStartupScript("muestraMensaje", SisPackController.GenerarJavaScripts.MostrarMensaje("Los datos se guardaron correctamente.")); } catch (Exception ex) { ((ErrorWeb)phErrores.FindControl("Error")).setMensaje(ex.Message); } }