Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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,

share|improve this question

1 Answer 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);
}
share|improve this answer
    
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

 
discard

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.