Issue with UpdatePanel and ProgressPanel nested in a composite control "The ControlID property of the trigger must reference a valid control" - please advise before i blowup the computer :-)

Rate It (1)

Last post 10-23-2006 12:32 PM by lior3790. 3 replies.

Sort Posts:

  • Issue with UpdatePanel and ProgressPanel nested in a composite control "The ControlID property of the trigger must reference a valid control" - please advise before i blowup the computer :-)

    10-22-2006, 12:07 PM
    • Member
      40 point Member
    • lior3790
    • Member since 10-22-2006, 11:50 AM
    • Posts 25

    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.

  • Re: Issue with UpdatePanel and ProgressPanel nested in a composite control - OK I solved this problem and now...

    10-22-2006, 1:48 PM
    • Member
      40 point Member
    • lior3790
    • Member since 10-22-2006, 11:50 AM
    • Posts 25

    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:

    public class BarGif : TemplateControl, ITemplate

    {

    private string _barPic;

    public BarGif(string template)

    {

    this._barPic = template;

    }

    public void InstantiateIn(Control container)

    {

    LiteralControl lc = new LiteralControl("<img src=&quat;"+this._barPic+"&quat;/>");

    container.Controls.Add(lc);

    }}

    public class RemTemp : SingleRecControl, ITemplate

    {

    public event System.EventHandler ProssFinished;

    private SophiaClass.DemoDbAcc dbAcc=new DemoDbAcc();

    private DataTable itemRateTable=new DataTable();

    public string userNam = "31";

    public RemTemp()

    {

    RecomTableBuilder();

     

    }

    protected void RecomTableBuilder()

    {

    dbAcc = new DemoDbAcc();

    itemRateTable = dbAcc.GetRateTable(int.Parse(userNam));

    if (!this.DesignMode) Thread.Sleep(4000);

    ItemName.Text = recItem.ItemName;

    ItemDesc.Text = recItem.ItemDescript;

    ItemPhoto.ImageUrl = recItem.ItemPhotoPath;

    }

    private Items MakeArrRec(DataTable table, int index)

    {

    recItem = new Items();

    recItem.ItemID = table.Rows[index]["id"].ToString();

    recItem.ItemName = table.Rows[index]["itemname"].ToString();

    recItem.ItemDescript = table.Rows[index]["itemDesc"].ToString();

    recItem.ItemPhotoPath = table.Rows[index]["itemPhotoPath"].ToString();

    return recItem;

    }

    }}

     

    please advise.......

    i feel so lucky to have someone to share my troubles :-)

    Lior

  • Re: Issue with UpdatePanel and ProgressPanel nested in a composite control "The ControlID property of the trigger must reference a valid control" - please advise before i blowup the computer :-)

    10-23-2006, 4:36 AM
    • Member
      40 point Member
    • lior3790
    • Member since 10-22-2006, 11:50 AM
    • Posts 25

    Is there anyone who faced the same development issues?

    please reply.

  • Re: Issue with UpdatePanel and ProgressPanel nested in a composite control "The ControlID property of the trigger must reference a valid control" - please advise before i blowup the computer :-)

    10-23-2006, 12:32 PM
    • Member
      40 point Member
    • lior3790
    • Member since 10-22-2006, 11:50 AM
    • Posts 25
    Can someone redirect me to more vivid forum than this?
Page 1 of 1 (4 items)