Where I should declare a session variable in asp.net
问题 I am building a Asp.net Application. I need to save a HashTable in a session. At page load i am writing protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["AttemptCount"]=new Hashtable(); //Because of this line. } } Here problem is, when a user refresh the page, session["AttemptCount"] also get refreshed. I want to know where should I declare Session["AttemptCount"]=new Hashtable(); So that my seesion do not get refeshed. EDIT In Global.asax, this session