where is my web control in the page hierarchy

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.
 
K

Konrad Rotuski

if you turn on Trace, you will see whole control tree at the bottom of the
page
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top