Html JsonResult

I need to return a JsonResult that contains some HTML.

so something like:

return Json(new { id="guid", html="<param id='id'/>" });

However, when I return the result, the angle brackets are encoded as u003e, u003c, etc.

I tried different encoders, but could not understand what it is. Does anyone come across this?

I can return Content (string) with Response.ContentType = "application / json" without this problem, but my json object is quite complex, and I would prefer to return JsonResult if possible.

Thanks!

+5
source share
2 answers

This is just Unicode. Once you show it in the browser, it will look great (if the browser is your client application).

+2
source

XSS HTML . . "\uxxxx" , .

+1

All Articles