ASP Panel loses its controls

1 posts, 0 answers
  1. Bobi
    Bobi avatar
    4 posts
    Member since:
    Feb 2012

    Posted 20 Mar 2015 Link to this post

    Hi, Support

    i have a dynamically added repeater to asp Panel control (see the code below)

    DataRepeater.ID = String.Format("DR{0}", ItemID);
    DataRepeater.DataSource = oToDoList;
    foreach (RepeaterItem RItem in DataRepeater.Items)
    { ... }

    This is working good, repeater is added to asp Panel. But, when I try to retrieve repeater items, it appears that panel doesn't contain any control.

    Repeater DataRepeater = (Repeater)pnlNiches.FindControl(String.Format("DR{0}", ItemID));
    if (DataRepeater != null)
        foreach (RepeaterItem RItem in DataRepeater.Items)
        { ... }

    I am sure that I don't clear panel controls in the code.
    What can be the reason of this strange behavior? Thanks in advance!

Back to Top