Link to home
Start Free TrialLog in
Avatar of ZekeLA
ZekeLAFlag for United States of America

asked on

Set ASP.NET set checkbox InputAttributes class in markup?

I just learned that <asp:checkbox CssClass="xyz"> puts the class tag in a span surrounding the rendered checkbox input element. I can add the class to the input element using server side code such as:

MyCheckbox.InputAttributes("class") = "xyz"

Is it possible to do this somehow directly from the aspx markup?

Thanks in advance.
Avatar of HainKurt
HainKurt
Flag of Canada image

did you try

<asp:checkbox Class="xyz">
Avatar of ZekeLA

ASKER

class is not a valid attribute of asp:checkbox
ASKER CERTIFIED SOLUTION
Avatar of gamarrojgq
gamarrojgq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZekeLA

ASKER

I'm using the class for jquery statements so it pretty much has to be on the element itself. Thanks anyway. Knowing it can't be done is a sufficient answer.