Sunday, 21 February 2016

Open and Close A Model Popup in sharepoint

For Open A PoPUp
<a href="javascript:SP.UI.ModalDialog.ShowPopupDialog('/sitPages.aspx', null, 500, 300);" >
Edit
 </a>

javascript:SP.UI.ModalDialog.ShowPopupDialog('PAgeAddress.aspx?ID={$thisNode/@TRFId}', null, 1000, 800);

javascript:OpenPopUpPageWithTitle('/SitePages/LeaderMessage.aspx',null,null,null,'Leader Message');


and Close A PoPUp from code behinde

public void CloseForm()
        {
            HttpContext context = HttpContext.Current;
            if (HttpContext.Current.Request.QueryString["IsDlg"] != null)
            {
                context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup()</script>");
                context.Response.Flush();    
                context.Response.End();
            }
        }

No comments:

Post a Comment