I think you could use an actual correct JS escape by doing JsString(model.userHome).stringify or something along those lines, and then it'd also be clear what was going on. you need @Html around it though potentially. Maybe @Html(JsString(model.userHome).stringify would work ... didn't test it or anything...