Thursday, August 25, 2011

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: $("#<%= EditTaskUrl.ClientID %>").val(),
            width: 800,
            height: 600,
            title: $("#<%= hiddenTitle.ClientID %>").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 = $("#<%= hiddenCurrentSite.ClientID %>").val();
            window.location = siteUrl
        }

< / Script>

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

No comments:

Post a Comment

Seven steps to build and deploy SPFX web part to SharePoint

Install Node.JS Use this link to install Node.JS https://nodejs.org/en/ 2.        Install yeomen and gulp CMD>npm install –g y...