I have a user control called container in which I am adding other user controls at run time.
I want to remove all controls from container, I am doing container.Controls.Clear() but my controls are still in memory, how can I make them null ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Suppose panel is you parent control which contains all child control , so loop through all child controls and call dispose method of each…that might resolve your issue
Calling clear method just remove your controls from the container control not from the memory so you need to dispose them…