We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Disposing of Session

When I set SessionMode = Aspose.Grid.Web.SessionMode.Session, how are the session variables that the Aspose Grid control created to hold the viewstate handled when the user closes the web page (perhaps to open another one)?

Does the grid somehow dispose of them automatically? How can I view them? Are they regular Session.Contents variables?

For example, assume that a web page with an Aspose Grid on it has been populated with several sheets, each with a lot of data. The user has done a bunch of work on the grid, so it's been going back and forth from the user to the server, thus invoking the viewstate being stored in a session var.

Also, assume that the page has a button to allow the user to open a different web page as part of the application.

OK, the user does his thing with the grid and saves the results, then clicks the button to redirect to another web page that does something entirely different.

If SessionMode = Aspose.Grid.Web.SessionMode.Session, then a lot of data must be stored somewhere and must be taking up memory.

How is it disposed of?



This message was posted using Aspose.Live 2 Forum


If you just close the browser window, there's no chance to let the grid clear its session data. But generally session state has timeout settings. By default the time is 20 min. That means if there are no activities after 20 minutes, the session will be canceled and the memory it holds will be free.

If you leave the grid's page and open another page, you may call Session.Clear() to clear all the session state and save memory.

If you still stay at the grid's page and you want to save memory, you may call GridWeb1.WebWorksheets.Clear();

Thank you for considering Aspose.