controls.clear()

  • Thread starter Thread starter chrisk
  • Start date Start date
C

chrisk

All:

Does the clear only clear the control objects or does it Dispose of
everything related (including the class in the code-behind). I am
assuming the later but the documentation is not clear on this and
wanted to hear feedback from others on this.

Thanks.
 
To more specific. I put an ASCXs into a PlaceHolder. I swap ASCXs
based on the state of the page. First I do a
PlaceHolder1.Controls.Clear() and next I do the normal LoadControl and
Controls.Add(ctlMyLoadedControl). There was a scenario where I was
starting a thread in on a method within an ASCXs CodeBehind (Class)
and when I swapped to a processing ASCX, kaboom! This lead me to
believe the clear is doing a dispose().
 
Back
Top