I wanna share…

Archive for the ‘Asp.Net’ Category

Good Reference–Chart Control in .Net.

Hi,
Nice article on Chart control..
Never miss to read..

Chart control in .Net

Thanks Scott Mitchell for sharing this…

Advertisements

To get number of online visitors(current) to your website(ASP NET).

Showing Current number of user in online is common in the part of developing a web site.

How to achieve that??? very simple.

1. Add Global.asax file to your application(web)

2. Add this code…

void Application_Start(object sender, EventArgs e)
{
Application[“Users”] = 0;
}

void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application[“Users”] = (int)Application[“Users”] + 1;
Application.UnLock();
}

void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application[“Users”] = (int)Application[“Users”] – 1;
Application.UnLock();
}

3. In the web.config file write this code…

<system.web>
<sessionState mode=”InProc” cookieless=”false” timeout=”15″ />
</system.web>

 

4. Use this code in your Home Page

No. of users in online ::::: <%= Application[“Users”].ToString() %>

 

5. Build and Run the application.

Hope it help you….