Developing new answer

Feb 23, 2010 at 1:04 PM

Hi all,

I try to add new answer types in the Survey's WebControls and I face a strange situation. Maybe it is related to my lack of understanding of the .Net Viewstate. Anyway the problem is:

when a user "Resumes" a survey and for some reasons press the "Save Progress" button in a Survey, it seems that the AnswerItems (implementing AnswerItem) loose their ViewState. In other words, whatever I store in the ViewState of an answer (example: ViewState["AnswerDownloadFile.TempFileName"] = TemporaryFileName;), at the next postback I dont get anything... I checked the ViewState content with a ViewState viewer and the values are encoded in base64. For some reasons, they are not "restored" in the ViewState after Init...

 

Please help!

Regards,

Coordinator
Feb 24, 2010 at 9:09 PM

Hello,

I've tried to replicate the situation you described:

- Demo Survey (v. 1.1.0)
- settings: resume of progress: manual mode - user must enter his code to resume
- security: email code protection

Next:
- invite user through email (generates email invitation + personal code)
- go to survey page and login with personal code
- answer two questions --> click "go to next page" --> click "save progress" --> close browserwindow + delete browsing history

Next:
- go back to survey page
- login with personal code
- click " resume" button --> survey restarts at question 3 (answers empty)

Next:
- answer question 3 and 4
- do not go to question 5 (next page) but click "save progress" --> close browserwindow + delete browsing history

Next:
 - go back to survey page
- login with personal code
- click " resume" button --> survey restarts at question 4 -_> answers of question 4 are all there (saved before)

Question: does this replicate the situation you mean? If so, is does not seem to match the error/problem you run into. The test was on an xp pro platform + IIS 5.1 Maybe you have some details?

Kind regards
Fwsmaster

 

 

Feb 25, 2010 at 7:32 AM

Hi Fwsmaster

Ok, the situation is this:

I answer a few questions (security mode is ASPNetContextSecurity) and "Save the Progress". The survey confirms the action with "Your survey progress has been saved on your computer"

I come back later and resume the Survey completion. The survey says: "Your session has been restored for resume"

I fill in a another question. But at this stage, if I "Save progress" again, then the ViewState will be empty. So the issue is observed after 2 "Save progress" actions. I wrote the ViewState code in the file AnswerFieldItem.cs in ~\Libraries\NSurvey_WebControls\Votations.NSurvey.WebControls\UI\AnswerItems

I got this with Firefox and IIS7 running on Windows 7 64bits.

Thanks for your kind help!