private void BindDdl()
 {
     if (!IsPostBack)
     {
         DropDownList_Kategori.DataSource     = db.Kategoriers;
         DropDownList_Kategori.DataValueField = "K_Id";
         DropDownList_Kategori.DataTextField  = "Kategori";
         DropDownList_Kategori.DataBind();
         DropDownList_Kategori.Items.Insert(0, new ListItem("Vælg kategori", "0"));
     }
 }
Exemple #2
0
    private void BindDdl()
    {
        if (!IsPostBack)
        {
            DropDownList_Kategori.DataSource     = db.Kategoriers;
            DropDownList_Kategori.DataValueField = "K_Id";
            DropDownList_Kategori.DataTextField  = "Kategori";
            DropDownList_Kategori.DataBind();
            DropDownList_Kategori.Items.Insert(0, new ListItem("Vælg alle kategorier", "0"));


            DropDownList_Maerke.DataSource     = db.Maerkes;
            DropDownList_Maerke.DataValueField = "M_Id";
            DropDownList_Maerke.DataTextField  = "Brand";
            DropDownList_Maerke.DataBind();
            DropDownList_Maerke.Items.Insert(0, new ListItem("Vælg alle mærker", "0"));
        }
    }