What is the proper JavaScript syntax for breaking out of an iframe and redirecting to a different URL within the same domain? I have a page inside an iframe with a form, and once that form is submitted, I want to open a separate page on the site in the parent window instead of the iframe. This is what I've attempted:
protected void ReplacePageClick(object sender, EventArgs e)
{
string url = "Contact.aspx";
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "RedirectScript", "top.document.location.href = " + url, true);
//top.document.parent.location.href?
//top.document.location.replace?
//window.parent.location?
//window.top.location.href?
//window.top.location.replace?
//parent.window.location.href?
//top.location.href?
// The code below works, indicating that javascript registration is successful
//cs.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('hello')", true);
}