I use modal dialogs. A modal dialog is build up with a mask div, and a container div. The container div contains an iFrame with the modal aspx page. When the modal dialog is initialized, the mask and container are added to the page body. When I close the modal dialog, the mask and container are removed from the body.
Everything works fine, and when I start debugging in Visual Studio, and open a new modal dialog, I see the new page in the debugger at ‘script documents – Windows Internet Explorer – somePage.aspx’
But when I close and remove the dialog, the page just stays ‘alive’ in the VS debugger, until I refresh the complete page.
Is this bad? Does the page ‘stay alive’ somewhere even tho its removed from the body? Or is it just a Visual Studio debugger UI thingy?
I found this question, about endlessly growing script block files. I think thats the same issue, but that question is not really answered there.
It is not enough to remove the container div that contains the iframe.
I expected that this would be sufficient to remove and destroy the iframe:
The container contains one other div (the modal dialog title) and an iframe.
That iframe is not removed by killing the container using the above code.
It looks like its not just a Visual Studio debugger issue, because the memory of the iexplore.exe process in windows task manager is also going up, and up, and up, every time I close and open a new dialog.
Solution:
When I explicitly remove the iframe, then the page does disapear from the debugger!
I can do that by saving the the iframe in a var on initializing the modal dialog, and then explicity remove the iframe when removing the modal dialog. This way:
on create / initialize modal dialog:
and on close modal dialog: