none
how to open Applicationpage.aspx in a modal dialog window. RRS feed

  • Question

  • hi , i want to open my applicationpage.aspx in modal dialog when i click button in webpartpage .aspx

    how to open Applicationpage.aspx in a modal dialog window.

    please help me solve this.

    Thanks,

    madhu.

    Thursday, December 27, 2012 10:59 AM

Answers

  • Hi,

    Try with below code.

    <script type="text/javascript">
        function portal_openModalDialog() {
            var options = SP.UI.$create_DialogOptions();
            options.url = '/_layouts/applicationpage.aspx';
            options.dialogReturnValueCallback = Function.createDelegate(null, portal_modalDialogClosedCallback);
            SP.UI.ModalDialog.showModalDialog(options);
        }
        function portal_modalDialogClosedCallback(result, value) {
            if (result === SP.UI.DialogResult.OK) {
                if (value != null) {

                }
            }
            if (result === SP.UI.DialogResult.cancel) {

            }
        }   
    </script>

     <input type="button" id="id" value="Submit" onclick="javascript:portal_openModalDialog(); return false;" />

    Let me know if you face any issues.

    Regards,

    Kumar.

    • Proposed as answer by Ravi S Kulkarni Thursday, December 27, 2012 12:29 PM
    • Marked as answer by MadhuMakkena Thursday, December 27, 2012 12:59 PM
    Thursday, December 27, 2012 11:15 AM