opening sharepoint pop up and closing pop up

–For opening pop up–
Write Below Script on page
<script type=”text/javascript”>
function openDialogModal() {
        var options =
        {
            url: $(“#”).val(),
            width: 800,
            height: 600,
            title: $(“#”).val(),
            dialogReturnValueCallback: refreshCallback
        };

SP.UI.ModalDialog.showModalDialog(options);

        function refreshCallback(dialogResult, returnValue) {
            //SP.UI.Notify.addNotification(‘Operation Successful!’);
            SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
           
            var siteUrl = $(“#”).val();
            window.location = siteUrl
        }

Add Attribute as


OnClientClick=  javascript : openSourceDialog();  return false;

–For closing pop up–
in code behind

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), “CloseAndRefresh”, “window.frameElement.commonModalDialogClose(1, 1);”, true);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s