Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         ddlIntendedMajor.DataSource     = Majors.GetMajors();
         ddlIntendedMajor.DataTextField  = "MajorName";
         ddlIntendedMajor.DataValueField = "MajorCode";
         ddlIntendedMajor.DataBind();
     }
     catch (Exception ex)
     {
         litMessage.Text    = ex.Message;
         litMessage.Visible = true;
     }
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PopulateGridWithApps();

                try
                {
                    ddlIntendedMajor.DataSource     = Majors.GetMajors();
                    ddlIntendedMajor.DataTextField  = "MajorName";
                    ddlIntendedMajor.DataValueField = "MajorCode";
                    ddlIntendedMajor.DataBind();
                }
                catch (Exception ex)
                {
                    lblMessage.Text    = ex.Message;
                    lblMessage.Visible = true;
                }
            }
        }