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

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...