c# - Retrieve Custom Data Annotations for create Custom LabelFor -
i creating custom labelfor
. inside want dataannotations
properties linked attribute dataannotations
created me , i'm not getting. example: obrigatorio
i need values of dataannotations
labelfor leave fields in bold when required. , depending on validation, leave customized styles.
my class
public class gruporisco : ientidadebase { [key] public int gruporiscoid { get; set; } [obrigatorio] [display(name="descrição")] public string descricao { get; set; } }
my custom atribute
public class obrigatorio : requiredattribute { public obrigatorio() { errormessage = "* obrigatório"; } }
the attribute above simple, create complex attributes.
Comments
Post a Comment