Groups | Blog | Home
all groups > asp.net building controls > september 2003 >

asp.net building controls : Find component in ASP.NET form at run-time


Sean Winstead
9/21/2003 7:54:46 PM

At design-time, it's possible to use
WebControl.Site.Container.Components to find a component (i.e., not a
WebControl). At run-time, WebControl.Site always appears to be null.
Is there a way to get access to the same information at run-time, so
that I can find a component on the form? Or is there a way to make
sure WebControl.Site is available?

--
Sean Winstead
Alan Corbett (.NET MVP)
9/25/2003 1:10:51 PM
Did you try:

this.Page.FindControl( "TheIdOfTheControl")?


[quoted text, click to view]

Sean Winstead
9/30/2003 7:36:08 AM

[quoted text, click to view]

Yes, it will only find components that inherit from Web.UI.Control and
so does not see plain ol' components.

--
Sean Winstead
AddThis Social Bookmark Button