SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web part from which I am popping up a aspx page that is used to upload a file. Code:

<a href="javascript:SP.UI.ModalDialog.OpenPopUpPage('/_layouts/MyProject/UploadFile.aspx');">

When I am done with my popup aspx page I would like to refresh a control on the original page (or the entire page) because there have been changes made that should be reflected. Is there a way to do this?

share|improve this question
up vote 3 down vote accepted

One way is to use the .parent property on your current object. Eg

Another way is by using jQuery as seen here

share|improve this answer
Ended up using window.parent.location.reload(true); in case anyone needs this. – Abe Miessler Apr 28 '11 at 4:54

In your code behind, render this to close the popup

            Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");

And change your javascript link to refresh the page when the popup closes:

javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/_layouts/",dialogReturnValueCallback: function(dialogResult, returnValue) { SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK) }})
share|improve this answer
btw this is for modal popup, not a popup page, but you may be able to adapt it for your scenario – djeeg Apr 16 '11 at 15:41
Can't seem to get it to work with a popup instead of a modal dialog – Abe Miessler Apr 16 '11 at 15:46

Your Answer


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.