controls.clear()

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.
 
C

chrisk

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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top