- Use quotes for non numeric datatypedataType.
- Do Not use quotes for numeric dataType.
- Use
Html.Rawto interpret your HTML data as is. - Take care of your HTML data to either escape the quotes meaning in server side, Or use a different quote than in data during assignment to javascript variable.
As you have already encountered this entity Name issue whichwith property assignment and if you remember we overcame it with the use of Html.Raw. So lets try that out. Lets combine Html.Raw and Json.Encode