It does, but because of how .NET handles anonymous types (thanks Mark), you need to change the dash to an underscore. Also the @
symbol is only needed when you are declaring the class in the Html attributes dictionary (since class is a reserved word). You can leave that off when declaring data-
elements.
@Html.EditorFor(model => model.information,
new { htmlAttributes = new { data_myvar="value" }})
When this is parsed by the helper, a dash will actually be rendered out in the HTML.
<input type="text" id="information" name="information" data-myvar="value"/>
To pass in multiple attributes, just separate the values by a comma
@Html.EditorFor(model => model.information,
new { htmlAttributes = new { data_myvar="value", data_othervar = "something" }})