Active Server Pages Programming (ASP)/Data in memory
Expert: Ashley Brazier - 10/15/2009
QuestionQUESTION: Hello,
In ASP if you have a grid on a page where the user will be adding data (rows). How can all the rows of data be kept in memory until the user saves them to the database?
Thanks in advance,
Richard
ANSWER: Hi,
You need to look in to sessions, this looks like a good article:-
http://www.dotnetspider.com/resources/20462-Bind-Gridview-from-Session-Then-Edit
its done using VB.NET is this ok?
Thanks
---------- FOLLOW-UP ----------
QUESTION: Hi Ashley,
One prob I foresee with keeping the data in the session, is that when the user leaves the page, the data stays in the session. How can the application detect when the user leaves the page?
Thank you in advance,
Richard
AnswerHi,
There is no full proof way of detecting if a user has left the site or closed the browser window.
I think by default the sessions clear/expire after 20 mins.
I've been looking for away to do this myself. In the global.asax on session start I would log the user in, but when they left/closed the end session would get executed.
Sorry I couldn't be more help.