Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ErrorMessageLabel.Visible = false;

        if (!IsPostBack)
        {
            // Populate data into dropdown lists.
            try
            {
                CommonService.CommonService commonService =
                    serviceLoader.GetCommon();

                // Agents.
                AgentDropDownList.DataSource     = commonService.GetAgentsList();
                AgentDropDownList.DataValueField = "UserId";
                AgentDropDownList.DataTextField  = "UserName";
                AgentDropDownList.DataBind();

                AgentDropDownList.Items.Insert(0, new ListItem("<All Agents>", "0"));
            }
            catch (Exception ex)
            {
                ErrorMessageLabel.Text    = "Unable to process the request. Please contact your administrator.";
                ErrorMessageLabel.Visible = true;

                log.Error("Unknown Error", ex);
            }
        }
    }