Count this page Hits
Hi, Sometimes we require some webpart to calculate the number of hits on a particular page. I am sharing a Hit counter webpart which will count the number of hits on any page if added to any particular page. Following are the steps to create this Webpart: Step1: Create a SharePoint 2010 solution using default basic template. Step2: Add a Simple webpart named "Hit Counter" to the project. The webpart class will contains following code: using System; using System.ComponentModel; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; namespace HitCounterWebPart.HitCounterWebPart { [ToolboxItemAttribute(false)] public class HitCounterWebPart : WebPart { string cLoginName = string.Empty; string cDate = string.Empty; string cURL = string.Empty; SPList myList; private const string listName = "HitsList"; private const string fieldUrl = "Url...