i want to find the number of login users every time when a login is done and but when i am creating it in asax file , there i have taken the application variablel to store the session of each login account but after closing the browser when i am again login
the account the session is expired and count is again is started from first one give the answer with code soon..............also how to store and retrieve the session with code reply me.............
If you want to statistics the number of users you can use the application variable. You can check whether the user has existed in the database. If it has existed you can increase the value of application variable. If you have used application variable you
may need to check whether the application has value or not. If the application variable isn’t null you don’t need to initialize it again.
i want to find the every time user visit the web site so i want to store the session of each user and show the visiter number every time when user see the web site please provide me the code....
Santoshkmr12...
Member
4 Points
3 Posts
how to store sessionid in database and how to retrive it
Jan 29, 2012 06:50 AM|LINK
i want to find the number of login users every time when a login is done and but when i am creating it in asax file , there i have taken the application variablel to store the session of each login account but after closing the browser when i am again login the account the session is expired and count is again is started from first one give the answer with code soon..............also how to store and retrieve the session with code reply me.............
Qi Wu - MSFT
Contributor
5794 Points
677 Posts
Re: how to store sessionid in database and how to retrive it
Jan 31, 2012 06:11 AM|LINK
Hi,
If you want to statistics the number of users you can use the application variable. You can check whether the user has existed in the database. If it has existed you can increase the value of application variable. If you have used application variable you may need to check whether the application has value or not. If the application variable isn’t null you don’t need to initialize it again.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: how to store sessionid in database and how to retrive it
Jan 31, 2012 03:32 PM|LINK
Hi,
Use Application State! It best suits your problem!
http://asp-net-example.blogspot.in/2009/01/aspnet-application-state-example-how-to_08.html
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Santoshkmr12...
Member
4 Points
3 Posts
Re: how to store sessionid in database and how to retrive it
Jan 31, 2012 05:15 PM|LINK
i want to find the every time user visit the web site so i want to store the session of each user and show the visiter number every time when user see the web site please provide me the code....
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: how to store sessionid in database and how to retrive it
Feb 01, 2012 01:36 PM|LINK
protected void Application_Start(object sender, EventArgs e) { Application["VisitorNo"] = 0; } protected void Session_Start(object sender, EventArgs e) { int VisitorCount = int.Parse(Application["VisitorNo"].ToString()); Application.Lock(); Application["VisitorNo"] = ++VisitorCount; Application.UnLock(); }</div> <div>In the .aspx page, handle Page_Load event and display the visitor's count!</div> <div>protected void Page_Load(object sender, EventArgs e) { Response.Write("Visitor No:" + Application["VisitorNo"].ToString()); }</div>Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Santoshkmr12...
Member
4 Points
3 Posts
Re: how to store sessionid in database and how to retrive it
Feb 10, 2012 01:44 AM|LINK
thank's sir i got the answer...