Problem knowing when to delete a session object

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi everyone,

I have a small problem. I have a process that allows the user to create a
new user for their website. In order to support this activity I have made a
custom object to use as a sesison entity. It basically just bundles up the
interim information over the create user pages into an easily accessible
object.

If the user clicks the cancel button, it is easy to delete this item from
the session.

However, if the user decides not to cancel, but to just select another menu
option to take them away from this page, what is the best way to trap this
and delete from the session?

I really need a generic process that perhaps could be built into my base
page class.

Any help would be greatfully received.

Kind Regards

Simon
 
Hi Simon:

You could create a base class for your other web form pages to derive
from. The base class could hook Page_Load and delete from the Session
if the page type is not a "new user registration page".

Overall it's difficult to do anything on the server based on a client
event. They might shut down thier browser, or lose thier network
connection - there is no perfect solution.

HTH,
 
Back
Top