Friday, 7 February 2014

count No of User Visited My web Site

Global asax:-

<% Application Language="C#"%>
<Script Runat="server" >
Public void Application_Start(Object Sender EventArgs e)
{
Application["No of user visited  My web Site"]=0;
}

public void Session Start(Object Sender Event Args e)
{
Application.Lock();
Application["No of User visited my web Site]=(int)Application["No of user Visited My web Site"] +1;
Application.Unlock();
}
</Script>

Default Page
<br>
No of user Visited web site
<tr>
<td>
<asp:Label Id="lblcount" runat="server">
</td>
</tr>
Page Load

lblCount.Text=Application["No of  user Visited my web Site"].To String());







No comments:

Post a Comment