Search This Blog

Tuesday, December 6, 2011

global.asax works on local computer but not after i publish to server

instead of the Application_Start because the first request might be local but later you could call the application on some other domain and it will no longer be local.
Local system code:

protected void Application_Start(object sender, EventArgs e)
{
Application["Visitors"] = 0;
// Code that runs on application startup
}

On Server Code:

protected void Application_OnStart(object sender, EventArgs e)
{
Application["Visitors"] = 0;
// Code that runs on application startup
}

No comments :