where is my web control in the page hierarchy

  • Thread starter Thread starter David
  • Start date Start date
D

David

Say a asp:textbox control on the web form. Where is it in the hierarchy of
the page object. I found out that it is not in page.Controls.

Looking at the Locals window where stepping through the code, if I follow
the tree..

- page
- Form
- System.Web.UI.HtmlControls.HtmlContainerControl
- System.Web.UI.Control
- _controls
- _controls
- here I am finding my web controls

WTF? Am I looking at it right? I am not that experienced with the Locals
window, but this seems crazy. Plus, why is the UI.Control under
HTMLControls????

My goal is to get a collection of all the asp.net web controls drawn on my
web form.
 
if you turn on Trace, you will see whole control tree at the bottom of the
page
 
Konrad, I didn't realize that, very handy

David, I can't speak directly to your example, but you *should* find your control in page.controls, presuming you've added it to the page and not some other container (panel, etc.)

----- Konrad Rotuski wrote: ----

if you turn on Trace, you will see whole control tree at the bottom of th
pag
 
Back
Top