Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Application Page + Modal popup continuous refresh

$
0
0

Hi All,

I am trying to open an application page as Modal Popup. But with the below code page iscontinuously refreshing.( I would like to open the popup on the page load)

<asp:HiddenFieldID="hdParticipated"Value="true"runat="server"/>

<asp:HiddenFieldID="hdSurveyID"Value="true"runat="server"/>

<scripttype="text/javascript">

    ExecuteOrDelayUntilScriptLoaded(function () {

        OpenDialog();

       returnfalse;

    }, "sp.js")

 

    function OpenDialog()

    {

    var IsParticipated = document.getElementById("<%=hdParticipated.ClientID%>").value;

    var surveyId = document.getElementById("<%=hdSurveyID.ClientID%>").value;

    if (IsParticipated == "false") {

       //        alert("Participation Needed");

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

        options.title ="Participate in Survey";

        options.width = 700;

        options.height = 600;

       //options.showClose = false;

        options.url = rootSite +"/_layouts/AspireZoneHR/Pages/Participate.aspx?SurveyID="+ surveyId;

        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallbackMHR);

        SP.UI.ModalDialog.showModalDialog(options);

       returnfalse;

    }

    }

 

  

 

    function CloseCallbackMHR(result, target) {

       if (result == SP.UI.DialogResult.OK) {

            alert(target);

            window.location.href = rootSite +"/Pages/Policies.aspx";

        }

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

           // Run Cancel Code

           //alert(target);

            window.location.href = rootSite +"/Pages/Policies.aspx";

        }

    }

 

</script>

 

Any help would be appreciated.

Let me know if you have any queires.

Thanks In Advance,
SPUser.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>