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?

1
  • You can use JavaScript to call SP.UI.ModalDialog.*Method*()
    – Bunzab
    Commented Feb 11, 2015 at 9:35

2 Answers 2

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);
1
  • Modal works with "SP.UI.Dialog.js"
    – Shiva
    Commented Feb 11, 2015 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); 

}

1
  • SP.UI is not part of sp.js though.. Commented Feb 20, 2015 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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