Thanks Karl,
I'll give the loop through a try. The reason I don't want to set the
visibility to false is because I could have one of quite a few user controls
loaded into the placeholder and if I have say, 5 user controls loaded, the
load event will fire in each user control contained within the placeholder
which is unnecessary.
Incidentally, how does a user control differentiate between the first time
it has been loaded into a page and subsequent times?
Regards
John.
"Karl Seguin" <kseguin##crea.ca> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Why don't you just set the visibility of the placeholder to false?
YourPlaceHolder.Visible = false
If you need to loop through this child controls, try this:
Public Sub HideControls(ByVal ParentCntrl As System.Web.UI.Control)
Dim ChildCntrl As System.Web.UI.Control
For each ChildCntrl in ParentCntr.Controls
ChildCntrl.visible = false
If ChildCntrl.HasControls = True Then
HideControls(ChildCntrl)
End If
Next
End Sub
if you actually want to loop through the controls,
"John" <a@b.com> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl... Hi all,
How do I iterate through a specific placeholder and remove or hide all
controls contained within that placeholder?
Regards
John.