PreviouslyCompleted return always "false"

Apr 4, 2008 at 11:41 AM
I've a simple survey with only a group of questions and it's redirect to a stats page using your XSLT file transformation. I'm using codebehind page and PreviousCompleted method reutrn always false.
Any suggestion?
Coordinator
Apr 9, 2008 at 4:57 AM
At what point in the page load cycle are you checking the .PreviouslyCompleted property?

Try doing it in Page_PreRender if you're not already.

-Steve
Apr 12, 2008 at 9:41 AM
Hello Steve!

Great work with this survey module.
I'm having the same issue as Rpruno: I was using the Page_Load event with the test

{
if (ws.PreviouslyCompleted) {
pnlPreviouslyCompleted.Visible = true;
pnlSurvey.Visible = false;
} else {
pnlSurvey.Visible = true;
pnlPreviouslyCompleted.Visible = false;
}
}

But the pnlPreviouslyCompleted was never shown. In debug mode I saw that, after I press the finish button, it executed twice the page_load: the first time PreviouslyCompleted was true but in the second it was false!

Using Init, InitComplete, LoadComplete Page_PreRender both times were false.

Can you please help me on this?
Thanks in advance,

Ricardo Pinto.
Coordinator
Apr 12, 2008 at 5:05 PM
Ricardo,

Here is the code that I'm using in the TestHarness, which I believe is working:

        public void Page_PreRender(Object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (ws.PreviouslyCompleted)
                    pnlSurveyPreviouslyCompleted.Visible = true;
                else
                    pnlSurvey.Visible = true;
            }
        }

Does that not work for you?

-Steve