When I display a chart and its title has an apostrophe, the title displays the ' as '.
How can I prevent this from happening?
<script>
var data = [];
var labels = [];
@foreach (var item in Model) {
@:labels.push("@Html.Raw(HttpUtility.JavaScriptStringEncode(item.TitleWithApostrophe))");
}
</script>
More about this question here: Javascript, Razor and Escape characters. Like apostrophe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With