Exemple #1
0
 public void LoadFoodDropDown(int GroupId)
 {
     fm.FoodGroupId          = GroupId;
     FoodDropDown.DataSource = fr.SelectByGroupId(fm);
     FoodDropDown.DataBind();
     FoodDropDown.DataTextField  = "Name";
     FoodDropDown.DataValueField = "Id";
     FoodDropDown.DataBind();
 }
Exemple #2
0
 protected void FoodGroupDropDown_SelectedIndexChanged(object sender, EventArgs e)
 {
     fm                      = new FoodModel();
     fm.FoodGroupId          = Convert.ToInt32(FoodGroupDropDown.SelectedItem.Value);
     FoodDropDown.DataSource = fr.SelectByGroupId(fm);
     FoodDropDown.DataBind();
     FoodDropDown.DataTextField  = "Name";
     FoodDropDown.DataValueField = "Id";
     FoodDropDown.DataBind();
     FoodDropDown.Items.Insert(0, new ListItem("-- please select --", "0"));
 }