In a CheckBoxList, how can I get the checkbox value that is set using checkboxlist.DataValueField?
In C# the value is accessible if I call the checkboxItem.value but in HTML the value renders as value="on".
EDIT: If this is not possible, is there an attribute I can add via a data source or to each ListItem individually that is accessible through HTML? Such as the input attribute name?
DataValueField is binding of column from checkbox datasource to checkbox value. Values in HTML are from datasource column with name from DataValueField and this field is not visible in HTML. This should explain it further.
EDIT:
You can add attribute to ListItem. You didnt provide any example of what You have now, but You can define checkboxlist:
add listitem with attribute in code behind:
This will result in generated markup like this:
So You can use span id to access Your input field from jQuery:
You may also be interested in this article.