These lines
double endCounter = Convert.ToDouble(DateTime.Now.TimeOfDay.TotalSeconds);
double totalSeconds = Convert.ToDouble( endCounter - startCounter);
Response.Write(totalSeconds);
Are not inside the scope of the method, move them in;
protected void Page_Load(object sender, EventArgs e)
{
double startCounter = Convert.ToDouble(DateTime.Now.TimeOfDay.TotalSeconds);
if (!IsPostBack)
{
}
double endCounter = Convert.ToDouble(DateTime.Now.TimeOfDay.TotalSeconds);
double totalSeconds = Convert.ToDouble( endCounter - startCounter);
Response.Write(totalSeconds);
}
Hope this helps,
Fredrik