randy_belcher Posted February 6, 2004 Posted February 6, 2004 how can i redirect the main page url from a asp.net page that is contained within an iframe? if i use response.direct("newpage"), it just changes the page in the iframe. Thanks. Randy Quote
kahlua001 Posted February 6, 2004 Posted February 6, 2004 Try javascript: parent.location.href='mypage.html' Quote
randy_belcher Posted February 6, 2004 Author Posted February 6, 2004 works like a charm! :) it took a little bit of code the way my project is setup, but all in all it works great. maybe someone else can use this code in their asp.net page. Thanks again for the help. strRedirect = "parent.location.href='LoginAgentStats.aspx'" ' Form the script to be registered at client side for the Javascript "onClick" event. Dim scriptString As String = "<script language=JavaScript> function Button1_onClick() {" scriptString += strRedirect & ";}" scriptString += "</script>" If (Not Me.IsClientScriptBlockRegistered("Startup")) Then Me.RegisterClientScriptBlock("Startup", scriptString) End If ' Call the Button1_onClick function Dim scriptString2 As String = "<script language=JavaScript> " scriptString2 += "Button1_onClick();" scriptString2 += "</script>" If (Not Me.IsStartupScriptRegistered("CallNow")) Then Me.RegisterStartupScript("CallNow", scriptString2) End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.