This is the code to open your page in modal dialog. To be used in the parent page
SP.UI.ModalDialog.showModalDialog({
url: url,
width: 800,
dialogReturnValueCallback: function (dialogResult, value) {
if (value == "1") {
window.top.location=window.top.location
}
}
});
This is the code to be used in the "Save" and "Cancel" buttons OnClientClick event
javascript:SP.UI.ModalDialog.commonModalDialogClose(1, '1');
javascript:SP.UI.ModalDialog.commonModalDialogClose(0, '0');
In this example we are sending the callback value to the calling function.
Based on the return value from modal dialog you can specify the action to be performed on the parent page.
Hope it Helps !!
For any calrification reply to this Answer. :)