I want to redirect from application page within a model box to site root web url but for some reason it dont work i am adding this code

ClientScriptManager.RegisterClientScriptBlock(typeof(System.Web.UI.Page), Guid.NewGuid().ToString(), String.Format("window.frameElement.navigateParent('{0}');", siteURL), true);

but it always takes me to page



1 Answer 1


window.frameElement.navigateParent - works only for popup windows. Is your application page opens in popup? You can easily use window.location.href instead of this. Also it is necessary verify that siteURL has correct value.

  • it did not works uncaught TypeError: Property 'href' of object [object Location] is not a function
    – Change
    Nov 20, 2013 at 15:00
  • It's because you use it like a function. The correct using is window.location.href = siteURL; Nov 20, 2013 at 15:07
  • still doesn't work :(
    – Change
    Nov 20, 2013 at 15:43
  • What the value of siteURL variable? Did you try Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), Guid.NewGuid().ToString(), "window.location.href = siteURL;", true); Nov 20, 2013 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.