Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding custom attributes to an asp:CheckBox control

I am trying to add a custom data-required attribute to an asp Checkbox control, it works fine for all other controls I've used it on, but on checkboxs it renders the checkbox inside a span that has the custom attribute on. I've tried adding the attribute in the markup and tried adding it to the control in the code behind. Any ideas?

like image 355
Tom Riley Avatar asked Mar 30 '12 08:03

Tom Riley


People also ask

What are custom attributes used for?

Custom Attributes. Custom Attributes are name-value pairs. You can use custom attributes to add custom descriptive fields to assets, devices, interfaces, themes, and vendors.


1 Answers

use InputAttributes

like image 51
Adrian Iftode Avatar answered Sep 16 '22 14:09

Adrian Iftode