Try the following, it works :) Note
data_role
instead of
date-role
.
@Html.TextBoxFor(model => model.Name, new { @data_role = "datebox", @data_options = "'mode':'calbox', 'useNewStyle':true" })
Also, I tried your way, w/ a dictionary, even that renders. I am not sure why it does not for you. One thing to note in both cases is that the ' (single-quote) in
data-options
is encoded, which you may have to decode.
Can you elaborate on your statement given below?
I want to include the DateGroup in my viewmodel, using a HtmlHelper, but it won't work