OK, here’s the situation, my parents went away on a week’s vacation…
No, wait, that was from “Parents Just Don’t Understand”.
Back to the 21st century, I was messing around with a Panel property connected to a ModalPopupExtender controls from the Ajax toolkit. I was trying to hide the panel in code behind, but I was running across this exception at run time:
_foregroundElement.ParentNode is null or not an object
It turns out that the problem was that I was hiding the Panel using the Visibility property:
myPanel.Visibility = false;
When I changed the way it was displayed, using a style instead, it worked: