How to add html5 data attribute to Html.TextBox in asp.net mvc?

TuffyA

New Member
The Html.TextBox syntax is:\[code\]public static MvcHtmlString TextBox(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes);\[/code\]So, i put my data attribute in \[code\]htmlAttributes\[/code\] : I have tried \[code\]@Html.TextBox("date",Model.Date,new { data-myid="aaa"})\[/code\],but that doesn't work for me.
 
Back
Top