protected override void CreateChildControls() { base.CreateChildControls(); this.Placeholder1.Controls.Clear(); if (this.AdditionElements != null) { MyTemplateContainer c = new MyTemplateContainer("content1"); this.AdditionElements.InstantiateIn(c); Placeholder1.Controls.Add(c); //while (c.Controls.Count>0) // this.Placeholder1.Controls.Add(c.Controls[0]); } }
protected void Page_Init(object sender, EventArgs e) { // base.OnInit(e); #region init_Components this.Page.InitComplete += Page_InitComplete; p1 = new Panel(); p1.ClientIDMode = ClientIDMode.AutoID; p1.ID = this.ID + "_p1"; if (this.ContentTemplate1 != null) { var container = new MyTemplateContainer(); this.ContentTemplate1.InstantiateIn(container); p1.Controls.Add(container); } p2 = new Panel(); p2.ID = this.ID + "_p1"; p2.ClientIDMode = ClientIDMode.AutoID; if (this.ContentTemplate2 != null) { var container = new MyTemplateContainer(); this.ContentTemplate2.InstantiateIn(container); p2.Controls.Add(container); } #endregion #region Registr Head var p = this.Page; p.ClientScript.RegisterClientScriptInclude("jquery-1_11_3", p.ClientScript.GetWebResourceUrl(this.GetType(), "ViControlsLib.jsResources.jquery-1.11.3.js")); if (this.Page.Header != null) { if (!this.Page.ClientScript.IsClientScriptBlockRegistered("jqx_base_css")) { var link = new HtmlLink(); link.Href = this.Page.ClientScript.GetWebResourceUrl( this.GetType(), "ViControlsLib.cssResources.jqx.base.css" ); link.Attributes.Add("rel", "stylesheet"); link.Attributes.Add("type", "text/css"); this.Page.Header.Controls.Add(link); this.Page.ClientScript.RegisterClientScriptBlock( typeof(Page), "jqx_base_css", string.Empty ); } } #endregion }