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 Submit button in my SPModalPopup.

By clicking submit button, after executing some code, I want to close the ModalDialog & Refresh the parent page. How can I do this ?

I have tried different following methods individually, but none of them is working.

1) this.Page.ClientScript.RegisterClientScriptBlock(.......);

2) HttpContext.Current.Response.End(); (This always give me NullReferenceException)

3) HttpContext.Current.Response.Write("window.opener='self';window.close();");

Also, in JavaScript file, I have written,

options.dialogReturnValueCallback = Function.createDelegate( null, modalDialogClosedCallback);

and its modalDialogClosedCallback method, but still its not working.

Please help me to close this & refresh page from server side.

share|improve this question

you could try this...

options.dialogReturnValueCallback: function(dialogResult) 

The page gets refeshed, when the Dialog is closed with "OK"

share|improve this answer

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.