SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

we are implementing a feature in sharepoint where the user can share documents, we are reworking our own UI to make it easier for the end user. We have a modal popup where you can select multiple users, once you click okay, they will receive a email and the permissions to edit the shared document.

In the user selection, we want to use a Modal, i know sharepoint already has a Modal where you can select multiple users, i was wondering if there where any ways we could use that one and change the OnOkButtonClick event to redirect to our custom functions to give the users permissions etc...

Thanks :D

share|improve this question
up vote 7 down vote accepted

There is this SP.UI.ModalDialog class (MSDN doku). With dialogOptions you can specify, how will your page behave after the user closes the dialog.

function OpenMasterdataDialog(strPageURL) {
    var dialogOptions = SP.UI.$create_DialogOptions();
    dialogOptions.url = yourPageWithDialogContent;
    dialogOptions.width = 750;
    dialogOptions.height = 950;
    dialogOptions.dialogReturnValueCallback = closedCallback; // Function to capture dialog closed event
    return false;

function closedCallback(dialogResult) {
   //your method to redirect to new page
share|improve this answer
This would be a new modal, am looking for ways to use already existing modals with all the controls already set and then just change the Callback on the OK button. An exemple of this would be when you go to site settings > site permissions > grant permission, the modal popup as what i need, cant i just use that one ? – Dr.Denis McCracleJizz Apr 12 '12 at 15:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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