void Application_Start(object sender, EventArgs e) { // Code that runs on application startup Application["activeuser"] = 0; } void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started Session["start"] = DateTime.Now; Application.Lock(); Application["activeuser"] = Convert.ToInt32(Application["activeuser"]) + 1; Application.UnLock(); } in ur defalut.aspx <% int i = Convert.ToInt32(Application["activeuser"]); Response.Write(i.ToString()); %> this will give the no of visitors in ur page
Thanks Karthik www.f5Debug.net
string currentUrl = System.Web.HttpContext.Current.Request.Url.AbsolutePath; if (Session["previousUrl"] != null) { if (Session["previousUrl"] != currentUrl) { int urlNew = (int)Application[currentUrl]; urlNew++; Application[currentUrl] = urlNew; string previousUrl = (string)Session["previousUrl"]; int urlOld = (int)Application[previousUrl]; urlOld--; Application[previousUrl] = urlOld; } } Label1.Text = ((int)Application[currentUrl]).ToString(); Session["previousUrl"] = currentUrl;
----- Suresh M
Login to post response