Reputation: 498
I have a custom attribute that I use in various elements in my ASP.NET HTML markup. Obviously it violates the DTD, and I get a validation error from Visual Studio. I hate ignoring errors in the error output window. Is there a way to suppress this error message? For example:
<label id="MyId" cid="MyCID" runat="server" />
cid is a custom attribute I use for various purposes, and it produces a validation error:
Validation (XHTML 1.0 Transitional): Attribute 'cid' is not a valid attribute of element label
Upvotes: 8
Views: 2826
Reputation: 23
Since the HTML5 standard, you can define custom attributes with the prefix data-
.
In your case, it will be data-cid="MyCID"
. This will remove the warning.
Upvotes: -1
Reputation: 8645
Goto Tools > Options > Text Editor > Html > Validation and turn it off. Simples.
Upvotes: 2