I've been googling to figure this out but I just can't find any information on this.
I have a .aspx page that is displayed within iframe of a php parent page.
When a button is clicked on the .aspx page, I close the iframe to go back to the php parent page, and here's the code I use:
void btnDone_ServerClick(object sender, EventArgs e)
Page.ClientScript.RegisterStartupScript(GetType(), "CLOSEWINDOW", "window.parent.postMessage('closeSurvey', '*');", true);
An iFrame is a window inside a document, you don't "close" it as such... reading the word "modal" , I guess you're using some kind of lightbox system that actually creates an iframe on the fly to display outside source in a lightbox.
So what you actually try to do is closing a lightbox, and you won't be able to do it cause https will prevent you to access an element from the parent page from the child page, while http lets you do this.