JsonResult with Html encoding

asp.net-mvc, c#

Solution

That's just Unicode. Once you show it in the browser it will look fine (if the browser is your client application).

Problem

I have to return a JsonResult, which contains some HTML. so, something like: ``` return Json(new { id="guid", html="<param id='id'/>" }); ``` However, when I get the result back , the angle brackets are encoded as u003e, u003c , etc.. I tried various encoders but can't figure this one out. Anyone run into this? I can return a Content(string) with the Response.ContentType = "application/json" without this issue, but my json object is pretty complex and I would prefer to return a JsonResult if possible. Thanks!

Original source