Hi Laurahn,
The Disposed event is inherited from Control class, and only fires when a
control is placed inside a container. Since a Page doesn't have a
container, the Disposed event isn't fired.
The Disposed event is called from the Dispose method, which is called
correctly for the Page class; therefore you could override the Dispose
method in your page class.
However, from your code, I can see you're using Session to store some
temporary variables. Could you please tell me why you want to do this? If
you need to clear those session variables when a page request is finished,
maybe you don't need to use Session to store them after all.
Normally when we need to persist some state across different page requests,
we can use Session, or ViewState, or global state. If it doesn't persiste
across a request, why not simply use a member variable?
Regards,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.