Getting to controls inside a user control?

Posted on 2007-10-16
Last Modified: 2008-01-09
I have a web user control with a control on it.

At design time I can only seem to get to the control this way:

Node n = ((UltraWebTree)this.FavoritesTree.FindControl("UltraWebTreeFavorites")).SelectedNode;

this.FavoritesTree is the name of the Web User Control

"UltraWebTreeFavorites" is the ID of a control that is part of the Web User Control.

I'd rather just do this:


or something ... but I can't seem to do that
Question by:knowlton
    LVL 16

    Expert Comment

    Are you able to modify the user control?

    If so you can expose the child control as a property of the user control.
    LVL 16

    Accepted Solution

    Example of a Property which exposes a label called Label1: -

        public Label MyLabel
            get { return Label1; }
            set { Label1 = value; }
    LVL 5

    Author Comment


    I'll have to try that when I get into work this morning.


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now