Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page_load vs Page_Unload

Status
Not open for further replies.

123ASP

MIS
Nov 2, 2002
239
US
hi,

I am trying to come up with a solution to a problem. I have created as main.aspx page which create a session variable. I want that session to be abandon once a user click on a Hyperlink So here what I thought the solution may be
1. <A HREF=' target='_top'>Yahoo</A>
I put onclick to run a function which contain session.abandon

2. Other solution that I thought about is since there is page_load function in every aspx page. can I use Page_Unload, it it exists or at lease use something similar.
thanks for your input
Al
 
Al

You can only clear your session from the server. If you wish to capture when a user clicks a link to leave your application and destroy their session before they go you will need to make the link postback to the server, allowing you to destroy the session before using Response.Redirect to forward them on to the relevant page.

Hope this helps

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top