Child Controls Processing
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Scott Watermasysk

I have a control that wraps around other controls:

<CN:ParentControl runat = "Server">
    <SUB:ChildControl runat = "Server" />
    <SUB:ChildControl runat = "Server" />
    <SUB:ChildControl runat = "Server" />
</CN:ParentControl >

Under certain conditions in ParentControl I set its visibility to false,
which of course hides the other three controls. This is the desired effect.
When I look at the control tree using Trace, I can still see the
SUB:ChildControl's(which makes sense).

However, for performance purposes, if you can't see it, it seems like a
waste to let it continue processing. Is it possible to disallow child
control processing if a certain parameter is met in the parent? Any
examples?

Thanks,
Scott

Reply to this message...
 
    
Ryan Trudelle-Schwarz
How are you building the children? If you were to use a custom control =
builder (or whatever it is called) you should be able to do checks and =
skip those children if required.

-----Original Message-----
From: Scott Watermasysk [mailto:Click here to reveal e-mail address]=20
=20
I have a control that wraps around other controls:

<CN:ParentControl runat =3D "Server">
    <SUB:ChildControl runat =3D "Server" />
    <SUB:ChildControl runat =3D "Server" />
    <SUB:ChildControl runat =3D "Server" />
</CN:ParentControl >

Under certain conditions in ParentControl I set its visibility to false,
which of course hides the other three controls. This is the desired =
effect.
When I look at the control tree using Trace, I can still see the
SUB:ChildControl's(which makes sense).

However, for performance purposes, if you can't see it, it seems like a
waste to let it continue processing. Is it possible to disallow child
control processing if a certain parameter is met in the parent? Any
examples?

Thanks,
Scott

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Scott Watermasysk (VIP)
I am not handling the building of the childcontrols myself. I have used
built a controlbuilder in the past, so maybe I will check that out.

In this case though, the childcontrol could be anything from plain text to a
usercontrol. My ParentControl functions properly, I just thought it would be
a good idea performance wise to not build the childcontrols if they aren't
going to be rendered back to the client.

Thanks for the suggestion.

-Scott

-----Original Message-----
From: Ryan Trudelle-Schwarz [mailto:Click here to reveal e-mail address]
Sent: Tuesday, May 14, 2002 1:06 AM
To: aspngcontrolscs
Subject: [aspngcontrolscs] RE: Child Controls Processing

How are you building the children? If you were to use a custom control
builder (or whatever it is called) you should be able to do checks and skip
those children if required.

-----Original Message-----
From: Scott Watermasysk [mailto:Click here to reveal e-mail address]

I have a control that wraps around other controls:

<CN:ParentControl runat = "Server">
    <SUB:ChildControl runat = "Server" />
    <SUB:ChildControl runat = "Server" />
    <SUB:ChildControl runat = "Server" />
</CN:ParentControl >

Under certain conditions in ParentControl I set its visibility to false,
which of course hides the other three controls. This is the desired effect.
When I look at the control tree using Trace, I can still see the
SUB:ChildControl's(which makes sense).

However, for performance purposes, if you can't see it, it seems like a
waste to let it continue processing. Is it possible to disallow child
control processing if a certain parameter is met in the parent? Any
examples?

Thanks,
Scott

---
[This E-mail scanned for viruses by Declude Virus]

| [aspngcontrolscs] member Click here to reveal e-mail address =
| YOUR ID http://www.asplists.com/asplists/aspngcontrolscs.asp =
| JOIN/QUIT http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com