I've some problems with serializing my C# objects into a plain JSON string.
I user JsonConvert ( Newtonsoft's one) to format a model into a JSON. The problem is that that JSON string get's used in some Javascript, but the format is not good as in a quote gets written down as ""e;" instead of "'". Any idea's on how to fix this ?
//...
@{
var dataJson = JsonConvert.SerializeObject(Model);
}
//...
<script>
function ChangeGroup(type) {
$.ajax({
url: //...,
data: @dataJson
});
}
</script>
what I get is this:
Some formatting options I forget to set ?