Hit Counter without Using Session and ViewState

This code helps you to count unique hit without Using Session and ViewState,declare static int variable at global level and increment count using + operator  ,The code will be look like as follows
 
The Counter is the static variable so its instance can not be created again again like normal variable so its once set value can not be erased and its value can be accessed at global level.
 
  1. static int counter = 0;  
  2.        protected void Page_Load(object sender, EventArgs e)  
  3.        {  
  4.            counter++;  
  5.            Response.Write(counter);  
  6.        }