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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Killing / removing 2 sessions

Status
Not open for further replies.

pinkpoppy

Programmer
Jul 6, 2011
75
US
Hello,

I am having some issues with killing 2 sessions I have in my application.
The application has 2 pages that takes data. Page 1 is session["ABC"] and data is taken from dropdownlist and textboxes. Page 2 is session["EFG"] and this page has a gridview that has dropdownlist and textboxes.

In Page 1, I have a <CANCEL> button that when the user clicks, they are asked to cancel. Then they are direct to the <HOME> page and the session["ABC"] is removed as the code I have for it works fine.

Session.RemoveAll();
Session.Abandon();
Session.Remove("ABC");
Response.Redirect("Home.aspx");
[/code]


In Page 2, I also have a <CANCEL> button and when the user clicks, they are again asked to cancel. They are direct to the <HOME> page. This is my issue. Session["ABC"] and Session["EFG"] does not get remove or abandon. And I have this code in place for the <CANCEL> button

Code:
Session.RemoveAll();
Session.Abandon();
Session.Remove("ABC");
Session.Remove("EFG");
Response.Redirect("Home.aspx");


When the user cancels from Page 1, sessions["ABC"] is killed, but when user cancels from page 2, session["EFG"] does not get killed. Any help or suggestion is appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top