With Razor html helpers it seems kind of poorly done to add custom html attributes.
I'm writing payment gateway integration and the card details need to be encrypted on the client's side.
Typical form field looks like
<input type="text" data-eway-encrypt-name="EWAY_CARDNUMBER" />
I have tried to replicate this with
@Html.TextBoxFor(m => m.Card.CardNumber, new { @class = "form-control", @data-eway-encrypt-name = "EWAY_CARDNUMBER" })
but no luck because it throws back
CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
Any Ideas?