I have several pages in my application. I have used a session variable called “Session[“Variable”]” that is set in page1 and page2. That means The scope should be in page1 and page2. If you go out any of these page will clear the above session variable. Is there any solution to clear the particular session varible in the application level. i.e i don’t want to write the code for each and every pages…
Share
If you used MasterPages or derive your pages from a base class, you can use a switch case and determine whether or not the current page is Page1, Page2 or something else. If it is “something else”, remove the key from the session.
IE: Switch case in the Page_load of the masterpage