TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
satish babu
1.1k
633
85.2k
About application memory
Nov 12 2011 6:08 AM
Hi friends,i have small doubt on application memory.I wrote the code in global.asax file as
public void application_start(....)
{
application["n"]=0;//initialization of variable
}
public void session_start(......)
{
application["n"]=(int)application["n"]+1;//for every time browser start incrementing the session variable
}
public void session_end(....)
{
application["n"]=(int)application["n"]-1;//decrementing the session when the session abandon
}
in default.aspx page
page_load(....)
{
response.write("number of users:"+application["n"].tostring());
}
in logout.aspx
i am taking an logout button
for the button click
protected void button1_click(.....)
{
session["n"].abandon();
}
when the user opens browser with default.aspx page he will see number of users opens his application
when the user clicks on logout button decrement the users from application memory.
It's working correctly but it increments only until to 2 and from 3rd request onwards it again starts from application_start() event.I cannot find the error where it is
can any one tell me the problem?
Reply
Answers (
1
)
How to write code for file upload control
Dot Net