/// <summary> /// Registers the specified parent key. /// </summary> /// <param name="parentKey">The parent key.</param> /// <param name="key">The key.</param> /// <param name="control">The control.</param> public static void Register(string parentKey, string key, IBaseUserControl control) { if (!string.IsNullOrEmpty(parentKey)) { lock (Controls) { if (Controls.ContainsKey(parentKey)) { if (Controls[parentKey] == null) { Controls[parentKey] = new Dictionary <string, IBaseUserControl>(); } if (Controls[parentKey].ContainsKey(key)) { Controls[parentKey][key] = control; } else { Controls[parentKey].Add(key, control); } } else { Controls.Add(parentKey, new Dictionary <string, IBaseUserControl>()); Controls[parentKey].Add(key, control); } } } }
protected void Page_Load(object sender, EventArgs e) { var step = (eSteps)Enum.Parse(typeof(eSteps), Request.QueryString["uc"]); _ControlToLoad1 = (IBaseUserControl)LoadControl("~/UserControl/" + step + ".ascx"); Paziente1.Visible = step != eSteps.Paziente; _ControlToLoad1.Azione = (eAzioni)Enum.Parse(typeof(eAzioni), Request.QueryString["azione"]); _ControlToLoad1.Chiave = Request.QueryString["chiave"]; //_ControlToLoad1.PopolaOggettiForm(); //_ControlToLoad1.CaricaDati(); // Gestione Delegate ----------------------------------------------------------- Del_GestioneMenuContestuale del_GestioneMenuContestuale = GestioneMenuContestuale; _ControlToLoad1.GestioneMenuContestuale = del_GestioneMenuContestuale; pnLoadControl.Controls.Add((Control)_ControlToLoad1); }