Untitled document
public static int count = 1;
void Application_Start(object sender, EventArgs e)
{
Application["MemberID"] = count;
}
void Session_Start(object sender, EventArgs e)
{
count = Convert.ToInt32(Application["myCount"]);
Application["MemberID"] = count + 1;
}
Now every time when visitor open your site the variable count will be increased by one.
► To Get the total at you home page you can write it as:
int a = Convert.ToInt32(Application["MemberID"]);