in global.asax:
i given this code
public static int count = 0;
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["myCount"] = count;
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
//count = Convert.ToInt32(Application["myCount"]);
count = Convert.ToInt32(Application["myCount"]);
Application["myCount"] = count + 1;
}
in aspx page i given this thing
protected void Page_Load(object sender, EventArgs e)
{
Application.Lock();
if(Application["HitCount"]!=null)
{
Application["HitCount"]=(int)Application["HitCount"]+1;
}
else
{
Application["HitCount"] =1;
}
Application.UnLock();
lblInfo.Text="The page has been accessed ("+Application["HitCount"].ToString()+") times";
but the problem here is it is counting up to certain time that means up to 1hr and again incrementing starts from 1 whats the problem and help me to overcome this one.