Does anyone see anything wrong with this:
this.Controls.Remove(this);
this is a class which extends user control. When I step through this section of code it looks like everything is fine, however nothing happens to the form. I would expect the control to be gone.
As mentioned, you’re removing the control from itself…that’s not likely what you want. I assume you want to remove the control from it’s parent – so you probably want
this.Parent.Controls.Remove(this);.Luckily, since you didn’t mention platform, the code is the same for WebForms or WinForms.