redirecting _top page from asp:login control in iframe onloggedin
Posted
by jumpdart
on Stack Overflow
See other posts from Stack Overflow
or by jumpdart
Published on 2010-05-20T17:03:11Z
Indexed on
2010/05/20
17:20 UTC
Read the original article
Hit count: 144
So yeah, Im building a little authenticated content(.NET app) to a large html site managed by another group. They are only comfortable with managing html so all my app content will be contained in iframes. Everything is working fine as far as navigation and calling services and whatnot but i cant bust out of the frame with my asp:login control. Im trying to register some JS on logged in but with no success.
Thanks
protected void login_LoggedIn(object sender, EventArgs e) { StringBuilder strScript = new StringBuilder();
strScript.Append("<script language='javascript'>");
string sHome = ConfigurationManager.AppSettings["AppHomePageURL"].ToString();
//strScript.AppendFormat("window.navigate('{0}');", sHome);
//strScript.AppendFormat("parent.location.href='{0}';", sHome);
//strScript.AppendFormat("window.open('{0}', '_top', '', false);", sHome);
strScript.AppendFormat("top.location.href='{0}';", sHome);
strScript.Append("WTF_let_me_outa_here();");
strScript.Append("</script>");
ClientScript.RegisterClientScriptBlock(typeof(Page), "LoginGO", strScript.ToString());
}
© Stack Overflow or respective owner