Last post Oct 14, 2013 04:49 AM by Starain chen - MSFT
Oct 12, 2013 06:04 PM|mallorz|LINK
I thought I had this but what I have currently only works if the browser does not close.
What I am trying to do is keep a continuous track record of how many individuals have successfully completed and submitted a survey. The survey itself was created using the Wizard tool in VS Studio Express, Web (2012). The values are getting successfully
stored in a database, however the survey count number does not increment as expected.
I think I'm on the right track - obviously just missing the part where the value stays whether the browser remains opened or closed.
Hopefully that makes sense; my code is below.
// Count survey number
if (Application["lastSurveyCount"] != null)
int curSurveyCount = Convert.ToInt16(Application["lastSurveyCount"]) + 1;
Session["surveyCount"] = curSurveyCount.ToString();
Application["lastSurveyCount"] = 1;
Session["surveyCount"] = Application["lastSurveyCount"];
Tips and/or advice?
** Edit: Upon doing more research, I see PROFILES may be the ticket, however much more complicated. Are there simpler ways?
Oct 14, 2013 04:49 AM|Starain chen - MSFT|LINK
Thanks for your post!
Based on my test in IE10, the SessionId will be lost when first close the browser and the SessionId will be remained regardless of the browser has been closed or not if get session again for the same request. I think that is the storage
mechanism of browser.
So, I suggest that you could consider use the cookie and set the expiration
time or store the data in the database.