c# - Add 'data-' attribute with MVC custom data annotation -
if add [requiredif(...
property have on view model class, mvc adds data-required...
attributes resulting mark-up property.
i want same; want decorate property of view model class [mymarkup]
, have render data-my-attribute
on rendered html property's editor.
i have looked high , low solution, , haven't found one, leads me suspect approach may wrong.
what i've tried
i've tried extending attribute
can't see how i'd access mark-up in there, since attributes wouldn't concerned mark-up.
i looked data annotations , metadata-aware implementations too, can't find allow me add data attribute element.
is possible @ all?
please note
i'm aware of html helpers , can pass in custom attributes them, want keep attribute.
Comments
Post a Comment