?
Solved

Clear SESSION variable on webform exit

Posted on 2005-04-19
4
Medium Priority
?
1,364 Views
Last Modified: 2008-01-09
Hi ,
I am working on a Purchase Order application in ASP.net.
I have a form that lets the user add a PO , entering its header and the details part of the PO.
I save the details part of the PO in a Datatable temporarily , till the user selects on ADD to add the PO to the database.
I store the Datatable in a SESSION variable.
What I want to do is clear this SESSION variable when the user exits the PO form. (i.e when the user moves to any other form in the application)

How can I do this??
0
Comment
Question by:TetraSA
2 Comments
 
LVL 12

Expert Comment

by:laotzi2000
ID: 13818235
You can do
session("po") = nothing
in the page_load event handler of any other forms.
0
 
LVL 9

Accepted Solution

by:
Rodney Helsens earned 1000 total points
ID: 13818761
Have you considered storing this in ViewState or another object, where it will not be persisted when leaving the page.

state management overview
http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_aspnetcon/html/0218d965-5d30-445b-b6a6-8870e70e63ce.asp
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question