Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have opened up a page in a modal dialog by using

OpenPopUpPage('myPage.aspx')

The page contains a button. Clicking on the button should cause the modal dialog to close, perform some server side action and redirect to the previous page with some parameter added (this is because I want to display a label revealing if the server side action was successful). I know that I can close the modal dialog from code behind using

System.Web.HttpContext context = System.Web.HttpContext.Current;
context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
context.Response.Flush();
context.Response.End();

but don´t know how to combine it with redirect functionality. I also observed that parameters are not added to the url.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

It can be accomplished with

context.Response.Write("<script type='text/javascript'>window.frameElement.navigateParent('myParentPage.aspx');</script>");
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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