1

Is there any server side reference for SP.UI.ModalDialog? What is the reference for SP.UI.ModalDialog for client side? How i reference this in webpart?

  • You can use JavaScript to call SP.UI.ModalDialog.*Method*() – Bunzab Feb 11 '15 at 9:35
0

All you have to do is refer to "sp.js" file provided by the sharepoint

if sharepoint : 2010:

<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="sp.js" 
    OnDemand="false" Localizable="false" LoadAfterUI="true"/>

or

<script src="/_layouts/sp.js" type="text/javascript"></script>  
<script src="/_layouts/SP.UI.Dialog.js" type="text/javascript"></script> 

If Sharepoint 2013:

New way of attaching the modal dialogs:

SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
  • Modal works with "SP.UI.Dialog.js" – Shiva Feb 11 '15 at 12:20
0

Firstly, if your code is in SharePoint site, there is no need of giving script refernce., because, sp.js will be already included in the Master Page.

Infact you can use this as below sample

function successHandler(data, textStatus, jqXHR) { 
SP.UI.Notify.addNotification("Created Successully", false); 

}

  • SP.UI is not part of sp.js though.. – Robert Lindgren Feb 20 '15 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.