I'm having a problem with adding a json value as a data-attribute in a html5 page.
We use the spark view engine (v1.5) in our asp.net mvc 2.0 website.
The following viewcode:
<a href='${Url.Action("edit", new { id = vehicle.VehicleId })}' title='Bewerken' class='dialog dialog-edit' data-dialogoptions='{"beforeOpen":"initAlarmZoneForm"}'><span class="silk-icon silk-icon-page-edit"></span></a>
is being rendered as:
<a href="/Alarm/AlarmZone/edit/4" title="Bewerken" class="dialog dialog-edit" data-dialogoptions="{"beforeOpen":"initAlarmZoneForm"}"><span class="silk-icon silk-icon-page-edit"></span></a>
note the enclosing double quotes in data-dialogoptions
A single quote is required to generate a valid json-string in the data-dialogoptions attribute.
Does anyone know what is causing this behavior and how I can change or work around it?