By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Page Member

P: n/a
I have a user control page named MyUC.ascx which has a Panel control
This Panel, in turn, has a TextBox. Next I use this user control in an
ASPX page named MyPage.aspx by registering the user control using the
following Register directive in the ASPX page

<%@ Register TagPefix="UC" TagName="UControl" Src="MyUC.ascx" %>

<form runat="server">
<UC:UControl ID="uc1" runat="server"/>
</form>

Now if I am not mistaken, the hierarchy of the controls in the ASPX
page would be

Page
Form
User Control
Panel
TextBox

As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?

Nov 24 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
nope :)

The Controls collection only contains the children controls, not the
children of the children (and so on).

rn**@rediffmail.com wrote:
I have a user control page named MyUC.ascx which has a Panel control
This Panel, in turn, has a TextBox. Next I use this user control in an
ASPX page named MyPage.aspx by registering the user control using the
following Register directive in the ASPX page

<%@ Register TagPefix="UC" TagName="UControl" Src="MyUC.ascx" %>

<form runat="server">
<UC:UControl ID="uc1" runat="server"/>
</form>

Now if I am not mistaken, the hierarchy of the controls in the ASPX
page would be

Page
Form
User Control
Panel
TextBox

As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?
Nov 24 '06 #2

P: n/a
Velislav, that means that even the Panel control is not a member of the
Page's Control Collection but the user control is a member of the
Page's Controls Collection, isn't it? Please correct me if I am wrong.

Thanks for the prompt response.
Velislav wrote:
nope :)

The Controls collection only contains the children controls, not the
children of the children (and so on).

rn**@rediffmail.com wrote:
I have a user control page named MyUC.ascx which has a Panel control
This Panel, in turn, has a TextBox. Next I use this user control in an
ASPX page named MyPage.aspx by registering the user control using the
following Register directive in the ASPX page

<%@ Register TagPefix="UC" TagName="UControl" Src="MyUC.ascx" %>

<form runat="server">
<UC:UControl ID="uc1" runat="server"/>
</form>

Now if I am not mistaken, the hierarchy of the controls in the ASPX
page would be

Page
Form
User Control
Panel
TextBox

As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?
Nov 24 '06 #3

P: n/a
<rn**@rediffmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?
No.
Nov 24 '06 #4

P: n/a
That is correct, the Panel is part of the User Control's Controls, but
not the Page's Controls.

To get to the Panel from the Page, you'd have to do something like

Page.Controls[userControlIndex].Controls[panelControlIndex]
rn**@rediffmail.com wrote:
Velislav, that means that even the Panel control is not a member of the
Page's Control Collection but the user control is a member of the
Page's Controls Collection, isn't it? Please correct me if I am wrong.

Thanks for the prompt response.
Velislav wrote:
nope :)

The Controls collection only contains the children controls, not the
children of the children (and so on).

rn**@rediffmail.com wrote:
I have a user control page named MyUC.ascx which has a Panel control
This Panel, in turn, has a TextBox. Next I use this user control in an
ASPX page named MyPage.aspx by registering the user control using the
following Register directive in the ASPX page
>
<%@ Register TagPefix="UC" TagName="UControl" Src="MyUC.ascx" %>
>
<form runat="server">
<UC:UControl ID="uc1" runat="server"/>
</form>
>
Now if I am not mistaken, the hierarchy of the controls in the ASPX
page would be
>
Page
Form
User Control
Panel
TextBox
>
As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?
Nov 24 '06 #5

P: n/a
The defining element here is the concept of Controls that are part of the
Page's Control tree, but which controls have their own child control
hierarchy.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"rn**@rediffmail.com" wrote:
I have a user control page named MyUC.ascx which has a Panel control
This Panel, in turn, has a TextBox. Next I use this user control in an
ASPX page named MyPage.aspx by registering the user control using the
following Register directive in the ASPX page

<%@ Register TagPefix="UC" TagName="UControl" Src="MyUC.ascx" %>

<form runat="server">
<UC:UControl ID="uc1" runat="server"/>
</form>

Now if I am not mistaken, the hierarchy of the controls in the ASPX
page would be

Page
Form
User Control
Panel
TextBox

As per the above hierarchy diagram, the TextBox is a member of the
Panel's Controls Collection but isn't the TextBox also a member of the
Page's Controls Collection here?

Nov 25 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.