how to session value in a page.
-
helllo.. i have a value stored in a session['foo']="bar"; and as sessions can be accessed in al the pages.. is there any way how to make the sessions inaccisssible in a specific page... ... thanks and regards..
-
helllo.. i have a value stored in a session['foo']="bar"; and as sessions can be accessed in al the pages.. is there any way how to make the sessions inaccisssible in a specific page... ... thanks and regards..
May i ask why you want to achieve something like that? Since your Page inherits from base type Page it allways should have access to the Session-Property. One thing you can try is to implement a BasePage-class that inherits from Page. In this class you set the access to Session as a private Member. e.g.:
private HttpSessionState Session
{
get{return base.Session;}
}But i dont know if this will work.
When in trouble, when in doubt, run in circles, scream and shout
-
May i ask why you want to achieve something like that? Since your Page inherits from base type Page it allways should have access to the Session-Property. One thing you can try is to implement a BasePage-class that inherits from Page. In this class you set the access to Session as a private Member. e.g.:
private HttpSessionState Session
{
get{return base.Session;}
}But i dont know if this will work.
When in trouble, when in doubt, run in circles, scream and shout
actually this was asked to me in an interview.. and my answer was to clear all the session variables on the page_init; he told that is there some kind of markup in the page which does this thing of skipping the session values for a single page... so is there any other way around...