protected void Page_Load(object sender, EventArgs e)
 {
     agents               = monitorDb.GetEnabledAgents();
     monitorValues        = monitorDb.GetMonitorValues();
     monitorCommands      = monitorDb.GetMonitorCommands();
     monitorCommandLimits = monitorDb.GetMonitorCommandLimits();
     if (!IsPostBack)
     {
         LoadUserInfo();
         LoadAgentGroups();
         ProcessAndLoadAgents();
     }
 }
 protected void Page_Init(object sender, EventArgs e)
 {
     if (Request.QueryString["id"] != string.Empty)
     {
         AgentId = Convert.ToInt32(Request.QueryString["id"]);
     }
     if (AgentId > 0)
     {
         ddlAgents.DataSource     = monitorDb.GetEnabledAgents();
         ddlAgents.DataValueField = "AgentId";
         ddlAgents.DataTextField  = "ScreenName";
         ddlAgents.SelectedValue  = Convert.ToString(AgentId);
         ddlAgents.DataBind();
     }
     else
     {
         ddlAgents.DataSource     = monitorDb.GetEnabledAgents();
         ddlAgents.DataValueField = "AgentId";
         ddlAgents.DataTextField  = "ScreenName";
         // ddlAgents.SelectedValue = AgentId.ToString();
         ddlAgents.DataBind();
     }
 }