Issue with UpdatePanel and ProgressPanel nested in a composite control "The ControlID property of the trigger must reference a valid control"
-
Hello to all the smart people, I'm trying to create a composite control which include nested controls from the great Ajax Dev. I overcame a lot of issues and can be helpful in some but my latest problem doesn't seem to disappeared. I can't trigger the ITemplate that i declared (maybe improperly?) to show first a Gif on the progress and afterwords the calculated information from the database. here are the templates: the code is as followed:
[DefaultProperty("Text")] [ToolboxData("<{0}:SingleRecControl runat=server>")] [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class SingleRecControl : CompositeControl { private ScriptManager sm = new ScriptManager(); UpdateProgress progBar = new UpdateProgress(); UpdatePanel ratePanel = new UpdatePanel(); ControlValueTrigger trig = new ControlValueTrigger(); public Label ItemName = new Label(); private Style[] objStyle = new Style[3]; protected override void CreateChildControls() { base.CreateChildControls(); Controls.Clear(); sm.EnablePartialRendering = false; sm.EnableViewState = true; sm.AppRelativeTemplateSourceDirectory = "~/Default.aspx"; sm.ID = "cc2"; sm.EnablePartialRendering = true; btn.Visible = false; btn.CommandName = "NEXT"; btn.ID = "Test"; btn.UseSubmitBehavior = false; btn.Text = "Test"; objStyle[0] = new Style(); ItemName = new Label(); ItemName.BorderStyle = objStyle[0].BorderStyle; ItemName.BorderWidth = objStyle[0].BorderWidth; ItemName.BorderColor = objStyle[0].BorderColor; ItemName.Width = objStyle[0].Width; ItemName.Height = objStyle[0].Height; ItemName.ID = "lblCheck"; ItemName.Text = "bl"; ItemName.Visible = true; this.Controls.Add(ItemName); progBar.ProgressTemplate = new BarGif("blablablablablabla"); progBar.ID = "GifBar"; ratePanel.ContentTemplate = new RemTemp(); ratePanel.ID = "RatePanel"; trig.ControlID = this.ID + "_" + ItemName.ID; trig.PropertyName = "Text"; this.ratePanel.Triggers.Add(trig); this.Controls.Add(sm); this.Controls.Add(progBar); this.Controls.Add(ratePanel); } protected override void Render(HtmlTextWriter writer) { base.Render(writer); this.Controls.Clear(); sm.RenderControl(writer