I am trying to display the following HTML using MVC3 Razor View:
<input id="EffectiveDate" name="EffectiveDate" type="date" data-options='{"mode": "flipbox"}' />
I was unable to get quotes in the data-options attribute for rendering. No matter what I try to do, they appear as"
Here are a few of the many approaches I've tried in my view:
@Html.TextBoxFor(model => model.EffectiveDate, new { type = "date", data_options= " { 'mode':'flipbox' }"})
and
@Html.TextBoxFor(model => model.EffectiveDate, new { type = "date", data_options= @Html.Raw("{\"mode\":\"flipbox\"}")})
Any suggestions on how to decode quotes?
source
share