protected void Page_Load(object sender, EventArgs e) { //count the number of visits if (Session["NumContactVisits"] == null) Session["NumContactVisits"] = 1;//assign 1 for the first visit else//accumulate on subsequent visits Session["NumContactVisits"] = (int)Session["NumContactVisits"] + 1; //display the number of visits with a cookie lblVisitCustomize.Text = "You have visited this page " + Session["NumContactVisits"].ToString() + " times. "; lblVisitCustomize.Visible = true; MessageList shoutBox; if (Application["ShoutBox"] == null) { shoutBox = new MessageList(); Application.Add("ShoutBox", shoutBox); } else { shoutBox = (MessageList)Application["ShoutBox"]; lblShoutBox.Text = shoutBox.ToString(); } if (ScriptManager1.IsInAsyncPostBack != true) txtComment.Focus(); }