Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                entities = new List <TypeBO>();
                entities = typeBLL.getList();

                typeDropDownList.DataSource     = entities;
                typeDropDownList.DataTextField  = "Name";
                typeDropDownList.DataValueField = "Id";
                typeDropDownList.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                entities = new List <TypeBO>();
                entities = typeBLL.getList();

                typeDropDownList.DataSource     = entities;
                typeDropDownList.DataTextField  = "Name";
                typeDropDownList.DataValueField = "Id";
                typeDropDownList.DataBind();

                string value = Request.QueryString["id"];
                int    id    = int.Parse(value);

                entity = studentBLL.findById(id);

                typeDropDownList.SelectedValue = entity.Type.Id.ToString();
                this.name.Text       = entity.Name;
                this.id.Value        = entity.Id.ToString();
                gender.SelectedValue = entity.Gender.ToString();
            }
        }