Exemplo n.º 1
0
 /// <summary>
 /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
 /// </summary>
 protected override void CreateChildControls()
 {
     if (this.PropertyControlUid != string.Empty)
     {
         Control c = DynamicControlFactory.CreatePropertyPage(this.Page, this.PropertyControlUid);
         c.ID = String.Format("wrapControl{0}", this.PropertyControlUid.Replace("-", string.Empty));
         mainContainer.Controls.Add(c);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the ValueChanged event of the hfPrimary control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        void hfPrimary_ValueChanged(object sender, EventArgs e)
        {
            if (hfPrimary.Value == string.Empty || hfPrimary.Value.Split('^').Length < 2)
            {
                throw new ArgumentException("hfUpdate");
            }

            string uid = hfPrimary.Value.Split('^')[0];

            mainContainer.Style.Add("display", "block");
            buttonContainer.Style.Add("display", "block");
            backgroundContainer.Style.Add("display", "block");

            this.PropertyControlUid = uid;

            Control c = DynamicControlFactory.CreatePropertyPage(this.Page, uid);

            c.ID = String.Format("wrapControl{0}", uid.Replace("-", String.Empty));
            mainContainer.Controls.Add(c);
            //TO DO: load PropertyPageControl + Bind
        }