I have a modal dialog that I call from my sender page:
function openCommentsDialog( ITEMID)
{
var DropDownListValue = document.getElementById("HideVal").value;
var options = SP.UI.$create_DialogOptions();
options.url = "/_layouts/SRP/SRPChange2.aspx" + "?Type=" + DropDownListValue + "&ItemID=" + ITEMID; //"SRPChange.aspx" + "?Type=" + DropDownListValue +"&ItemID=" + ITEMID;
options.height = 600;
options.width = 800;
options.allowMaximize = false;
options.Title = "SRP Change Dialog";
**options.dialogReturnValueCallBack = Function.createDelegate(null, dialogCloseCallBack);**
SP.UI.ModalDialog.showModalDialog(options);
}
This is the callback function on the sender page:
function dialogCloseCallBack(result, returnValue) {
SP.UI.ModalDialog.RefreshPage(result);
}
On the dialog page I have dynamically added a "Close" button. I have tried client script and server script but the diaglogCloseCallBack function on the sender page never fires:
Client:
<script type="text/javascript">
function closeWindow() {
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.Close,null);
}
Server:
private void Close_OnClick(object sender, EventArgs e)
{
this.Context.Response.Write("<script type='text/javascript'>window.frameElement.commonModalDialogClose(0,null);</script>");
this.Context.Response.Flush();
this.Context.Response.End();
}
-->
