I am trying to render out the following JSON in an attribute on a TableRow:
{"key": "value"}
The complete output should look like this:
<tr data-json='{"key": "value"}'> ... </tr>
However, if I do:
var tr = new TableRow();
tr.Attributes.Add("data-json", "{\"key\": \"value\"}");
… The double quotes get serialized:
<tr data-json="{"key": "value"}"> ... </tr>
The only solution I’ve come up with is to extend the TableRow control and render out attributes manually. If this is the case; could you guys suggest an implementation?
I ended up creating my own TableRow class: