dimanche 28 octobre 2018

Asp.Net Foreach does not work can someone help me?

My Foreach does not work can someone help me?

C#

foreach (var Cat in db.Categorias)
        {
            var id_Categoria = db.Categorias.Where(x => x.IdCategoria.Equals(Cat.IdCategoria)).FirstOrDefault();
            if (id_Categoria != null && !Cat.IdCategoria.Equals(Cat.IdCategoria))
            {

            Plh_email.Controls.Add(new LiteralControl("<asp:Button ID='Cat_"+ Cat.IdCategoria +"' runat='server' Text='" + Cat.NomeCategoria + "' />"));

            }
        }




Aucun commentaire:

Enregistrer un commentaire