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 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

1 Answer 1

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.