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.
when i declare a trigger in the code page of the composite control i get this error message:
"The ControlID property of the trigger must reference a valid control"
even thoughi placed everything correctly (at least in my understanding).
the code is as followed:
[DefaultProperty("Text")][ToolboxData("<{0}:SingleRecControl runat=server></{0}:SingleRecControl>")][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;//Controls.Add(sm);
btn.Visible = false;btn.CommandName = "NEXT";btn.ID = "Test";btn.UseSubmitBehavior = false;btn.Text = "Test";
//_container = new CompositionUpdatePanel(this);
//_container.ID = "Container";
//_container.Mode = UpdatePanelMode.Conditional;
//Controls.Add(_container);
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);
progBar.RenderControl(writer);
ratePanel.RenderControl(writer);
ItemName.RenderControl(writer);
}
can someone please help me?
Lior S.