Select WebContainer by ControlID

I am spawning a new container within my web app and want to select it by Control ID to close it when the user is done with it.

My plan is to instantiate them via code, load the ControlID into a variable that defines the active control ID for what is being displayed, and then use that variable to close the content out.

If I recall correctly, indexes can change when a page is re-indexed, and such would result in the wrong thing being closed if I called .Close on whatever got assigned the index of the container I want to close.

For now, I plan on simply showing and hiding the five containers I am using in my app’s content section, until I can sort the issue of selecting by ControlID.

I also need to be able to select by ControlID so I can adjust the position of the container to react to the showing and hiding of content above it.

You could keep the containers referenced in an array and then pick one to close.
Or have a widget in the container which calls self.close.

But usually you don’t need to close them as they close automatically when the page is destroyed at the end of the session.