Access web user control in code behind

2 posts, 0 answers
  1. Robert
    Robert avatar
    20 posts
    Member since:
    Jul 2013

    Posted 03 Jul 2013 Link to this post

    I have a web user control(NavigationControl.ascx) where I build a PanelBar and it contains another web user control.
    <telerik:RadPanelBar runat="server" ID="SearchOptionsPanel" Width="172px" Skin="CMASkin" EnableEmbeddedSkins="false"
        OnClientItemClicked="PanelBarItemClicked">
        <Items>
            <telerik:RadPanelItem Text="Search Options" Expanded="true" Value="MeasureOptions">
                <Items>
                    <telerik:RadPanelItem Text="">
                        <ItemTemplate>
                            <uc1:DischargeListCriteriaControl ID="DischargeListCriteriaCtrl" runat="server" />
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    

    How do I access the "DischargeListCriteriaControl" from the codebehind of the NavigationControl.ascx.cs.  The below doesn't work.
    public DischargeListCriteriaControl DischargeListCriteriaControl
    {
        get
        {
            return this.DischargeListCriteriaCtrl;
        }
    }
    
  2. Robert
    Robert avatar
    20 posts
    Member since:
    Jul 2013

    Posted 03 Jul 2013 Link to this post

    figured it out.
    public DischargeListCriteriaControl DischargeListCriteriaControl
    {
        get
        {
            return ((DischargeListCriteriaControl)this.SearchOptionsPanel.Items[0].Items[0].FindControl("DischargeListCriteriaCtrl"));
        }
    }
    
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top