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
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!
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!