Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page Member

Reply
Thread Tools

Page Member

 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      11-24-2006
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?

 
Reply With Quote
 
 
 
 
Velislav
Guest
Posts: n/a
 
      11-24-2006
nope

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

http://www.velocityreviews.com/forums/(E-Mail Removed) 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?


 
Reply With Quote
 
 
 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      11-24-2006
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).
>
> (E-Mail Removed) 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?


 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      11-24-2006
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.


 
Reply With Quote
 
Velislav
Guest
Posts: n/a
 
      11-24-2006
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]


(E-Mail Removed) 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).
> >
> > (E-Mail Removed) 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?


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      11-25-2006
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




"(E-Mail Removed)" 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?
>
>

 
Reply With Quote
 
 
 
Reply

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
Performance and nitty gritty things like this.member v member foldface@yahoo.co.uk ASP .Net 1 10-07-2004 09:24 AM
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. DJ Dev ASP .Net 3 02-08-2004 04:19 PM
How would I use qsort to sort a struct with a char* member and a long member - I want to sort in order of the long member Angus Comber C Programming 7 02-05-2004 06:41 PM
Passing a pointer to member function as a parameter to another member function Newsgroup - Ann C++ 5 07-30-2003 02:54 AM
how do I access a member of vector when this vector is a member of a class ding feng C++ 8 07-02-2003 08:06 AM



Advertisments