I have a list of items in an html table. On each row (tr) I’m proceeding like this:
<tr idAffaire="@suite.IdAffaire" idSuite="@suite.IdSuite" class="@suite.Username row droppable">
I used the attributes idAffaire and idSuite for retrieving some infos later. I know the official identification attribute is “id” but in my case I need 2 id. When I compile my code, VS is warning me about some things:
- this name contains uppercase characters, which is not allowed.
- attribute ‘idaffaire’ is not a valid attribute of element ‘tr’
- …
Is it possible to prevent these warnings? Is there a better way of doing?
Thank you.
The problem is that you are writing invalid HTML. As you mentioned,
idis a valid attribute butidAffaireoridSuiteare not. I’m assuming from the fact that you get a warning about uppercase characters, you are using an XHTML doctype. A better way to do this would be to use an HTML5 doctype:And use custom data attributes for your new attributes: