Does anyone know how to pass html attributes like "data-date" to the Html.TextBox()??
It is used from the bootstrap datepicker.
Is there a way around it?
@Html.TextBoxFor(p => p.DateFrom, new { @class = "small", type = "date", "data-date"="12-02-2012" })
I was trying to add the date picker to the Html helper using bootstrap. rudeovski ze bear's answer made it easier.
This is how it worked for me.
You have to use underscore instead of '-'.
So what you're after would go something like this:
Use:
instead of: