Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Modal dialog is not closing upon click of "OK" button. But it getting closed upon click on "Cancel" button.

$
0
0

Hi,

I have open a modal dialog. When a user click on the "Cancel" button the dialog close which fires the dialog closing event. But when user click on the "Ok" button, dialog remains opens and does not close. Please have a look to my code below,

 function openModalPopupAndAdd(gridControlName) {
        
        var options = SP.UI.$create_DialogOptions();
        options.url = "/_layouts/AssetEditHyperLink.aspx";
        options.width = 750;
        options.height = 750;
        options.dialogReturnValueCallback = Function.createDelegate(null, modalReturnValue);
        SP.UI.ModalDialog.showModalDialog(options);
        return false;                
    }

    function modalReturnValue(dialogResult, returnValue) {
        
        if (dialogResult == SP.UI.DialogResult.OK) {
            alert(dialogResult);
        }
        else if (dialogResult == SP.UI.DialogResult.cancel) {
            alert(dialogResult);
        }
    }

Thanks in advance.

Regards,


Viewing all articles
Browse latest Browse all 11571

Trending Articles