none
unable to open Modal Popup using SP.UI.ModalDialog.showModalDialog

    Question

  • HI i trying to use modal popup bye using SP.UI.ModalDialog.showModalDialog class i directly calling that methed in my button click in my web part i am tring to access that page popup is getting open(empty url ) i am using like this

    OnClientClick="javascript:SP.UI.ModalDialog.ShowPopupDialog('/_LAYOUTS/SharePointSignUP/TermsAndCondition.aspx');"

    even if try like this  i am not gettting my Application page

    var options = SP.UI.$create_DialogOptions(); options.width = 900;

    options.height = 400;

    options.resizable = 1;

    options.scroll = 1;

    options.url =

    "/_LAYOUTS/SharePointSignUP/TermsAndCondition.aspx";

    SP.UI.ModalDialog.showModalDialog(options);


    Srinivas


    Tuesday, July 16, 2013 7:50 AM

Answers

  • use function like this:

    <script type="text/javascript">
        // <![CDATA[
        function openDialog() 
        {
            var options = 
            {
            url:"put url here",
            width: 800,
            height: 600,
            title: "abc",
            };
        SP.UI.ModalDialog.showModalDialog(options);
        }
        // ]]>
    </script>

    call this openDialog function on click event like below:

    onclick="javascript:openDialog(); return false;"

    hope this helps. :)


    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer




    • Edited by MeShare Tuesday, July 16, 2013 8:20 AM ddfdfdffd
    • Marked as answer by srini Sharepoint Tuesday, July 16, 2013 8:58 AM
    Tuesday, July 16, 2013 8:16 AM