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
Bhabani prasad Dash
NA
244
44.6k
online user total user count
May 24 2013 2:40 AM
i want online user and total visitor to my site i take two label to show online user and total user.and write below code in global.asax
and for load .but it always show output online user 1 that is correct but total user also 1.so i want when agai i run my application it will show total user2,3,4 so on
lbl_onlineuser.Text = Application["onlineuser"].ToString();
lbl_totaluser.Text = Application["Totaluser"].ToString();
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["Totaluser"] = 0;
Application["onlineuser"] = 0;
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session.Timeout = 20;
Session["Start"] = "Now";
Application.Lock();
Application["Totaluser"] = Convert.ToInt32(Application["Totaluser"]) + 1;
Application["onlineuser"] = Convert.ToInt32(Application["onlineuser"]) + 1;
Application.UnLock();
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
Application.Lock();
Application["onlineuser"] = Convert.ToInt32(Application["onlineuser"]) - 1;
Application.UnLock();
Reply
Answers (
4
)
Store value from ListView items(column2) to List
How to transfer a file from my pc to server..