1

i am building a .aspx Terms & condition page for my Intranet with Save & Cancel buttons:

When we click on Save the user save inside a list as he agree on the terms & Condition content & the cancel button redirect to another site if they not agree on the content!

But i need your suggestion on below issue:

1 - How i can Hide the Terms & Condition page for the user that was agree on the content !

2- How we set the page to popup on the welcome page site instead of a normal page

Any Help !

regards,

1

You can use sharepoint dialog and cookies to this purpose.

Personally I would insert some javascript which would handle the check and popup in the masterpage or load it in a delegate control placed in the masterpage.

Javascript to load your .aspx:

var dialogOptions = {
        title: "Terms & Conditions",
        url: "/_layouts/PathToYourPage.aspx",
        allowMaximize: true,
        showMaximized: false,
        showClose: true,
        autoSize: true,
        dialogReturnValueCallback: function () { }
};    
SP.UI.ModalDialog.showModalDialog(dialogOptions);

You must then in your .aspx page set a cookie which you check if exists in the above javascript.

I can recommend the jQuery.Cookie plugin for handling the cookie part.

Example:

var termsAcceptedCookie = jQuery.cookie("NameOfTheCookieHere"); // Could be a boolean.
if (!termsAcceptedCookie)
{
    var dialogOptions = {
        title: "Terms & Conditions",
        url: "/_layouts/PathToYourPage.aspx",
        allowMaximize: true,
        showMaximized: false,
        showClose: true,
        autoSize: true,
        dialogReturnValueCallback: function () { }
    };    
    SP.UI.ModalDialog.showModalDialog(dialogOptions);
}
  • Would you help me more and give the steps : 1- to create the Delegation control & 2- where i can add the onload function to check and poup the content ! Thanks in advance – HaSS Apr 17 '13 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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