Problem knowing when to delete a session object

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
 
S

Scott Allen

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top