Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to access user control child controls

Thread Tools

How to access user control child controls

Posts: n/a
Hi there,
I am loading some user controls and I want to populate the
child controls within them, but can't access them. I doing the following in
a loop. However the TitleText or other child controls are not available.
They have the runat server tag.

NoticeItem uc = (NoticeItem)Page.LoadControl("~/noticeitem.ascx");

uc.TitleText = "Some text";



Reply With Quote
Posts: n/a
I got around the probem by adding some public properties to the user control
like so:

public String Title
set { TitleText.Text = value; }

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Controls.Add() for a Web User Control doesn't instansiate its child controls Ofer Zelig ASP .Net 15 03-28-2007 01:15 PM
ASP.NET Templated User Controls - Limit child controls allowable within a templated control ASP .Net 0 05-29-2006 06:00 PM
HELP! Child controls of child controls not visible to web app ASP .Net Building Controls 0 05-05-2005 09:14 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM