This is a very simple page to list server status, I use an updatePanel and 1 count down clock to refresh this panel every 60 seconds.

Behind the clock is a C# ping method that get the server status(up or down), then write to the labels on the page.



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServerStatus.aspx.cs" Inherits="ServerStatus" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:Timer ID="Timer2" runat="server" ontick="CD_Ticker"  Interval="1000"></asp:Timer>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <table style="width:100%;">
                    <td> This page will refresh after <asp:Label ID="CDLabel" runat="server" Text="60" ></asp:Label> seconds.</td>
                    <td><asp:Label ID="Label1" runat="server" ForeColor="black"></asp:Label></td>
                    <td><asp:Label ID="Label2" runat="server" ForeColor="black"></asp:Label></td>
                    <td><asp:Label ID="Label3" runat="server" ForeColor="black"></asp:Label></td>
                    <td><asp:Label ID="Label4" runat="server" ForeColor="black"></asp:Label></td>
            <asp:AsyncPostBackTrigger ControlID="Timer2" EventName="tick" /> 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.NetworkInformation;
using System.Drawing;
using System.Windows.Forms;
using System.Windows;
public partial class ServerStatus : System.Web.UI.Page
    /* Initialize the page while checking servers */
    protected void Page_Load(object sender, EventArgs e)
    /* Count Down clock and run server check every 60 Seconds */
    protected void CD_Ticker(object sender, EventArgs e)
        if (Convert.ToInt32(CDLabel.Text).Equals(0))
            CDLabel.Text = "60";
            CDLabel.Text = Convert.ToString((Convert.ToInt32(CDLabel.Text) - 1));
    /*you can put the list here, or use table however I dont have so many server to be listed so far */
    public void ServerCheck()
        FindAndPrint("", "Label1");
        FindAndPrint("", "Label2");
        FindAndPrint("", "Label3");
        FindAndPrint("", "Label4");
    /*this will check the IPaddress then modify the related Label */
    public void FindAndPrint(String IPaddress, String LabelName)
        System.Web.UI.WebControls.Label l = (System.Web.UI.WebControls.Label)FindControl(LabelName);
/* if you are using Master Template, you need use those code to replace the top line 
ContentPlaceHolder temCont = (ContentPlaceHolder)Master.FindControl("MainContent");
Label l = (Label)temCont.FindControl(LabelName);*/
        if (IsConnected(IPaddress))
            l.Text = "Online";
            l.BackColor = Color.Green;
            l.BorderColor = Color.Black;
            l.Text = "Offline";
            l.BackColor = Color.Red;
            l.BorderColor = Color.Yellow;
    /* a ping method to return true or false on ping server */
    public static bool IsConnected(String IPaddress)
        bool result = false;
        Ping p = new Ping();
            PingReply reply = p.Send(IPaddress, 3000);
            if (reply.Status == IPStatus.Success)
                return true;
        catch { }
        return result;


About Lei

I am an IT specialist with over 10 year experience - years on Automation, on-Premise or Azure.

I am happy to develop however never want be a full time developer. Only do what I have to do. If it has to be PowerShell,HTML, PHP, CSS, C#, VBS or JS, front end or backend, so be it, doesn't matter!

Spent years with Windows, SCCM, SharePoint, SQL and Exchange servers. For last several years, I have been actively working under On Premise > Azure environment.


Current Certificates:
    Microsoft® Certified-
  • -Enterprise Administrator
  • -Database Administrator
  • -SharePoint Administrator
  • -Administering and Deploying SCCM 2012
Red Hat Certified Technician
ITIL V3 Foundation - Practitioner

Working on Azure Certificates now and hopefully they can stop upgrading their questions one day! GIVE ME A BREAK!

Contact Lei

Name *
Email *
Comments *

Traffic since 10/08/2016

This week517
This month2590

Visitor Info

  • IP:
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online