Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正确的JSON格式化C#字符串_C#_Json_Unicode - Fatal编程技术网

正确的JSON格式化C#字符串

正确的JSON格式化C#字符串,c#,json,unicode,C#,Json,Unicode,如果在MVC中执行此操作: var jsonData = new { myimage = "<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />" }; return Json(jsonData); 如何将其作为值获取,或者在将其添加到innerHtml时,如何正确解释它们 "<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />"

如果在MVC中执行此操作:

var jsonData = 
    new { myimage = 
        "<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />" };

return Json(jsonData);
如何将其作为值获取,或者在将其添加到innerHtml时,如何正确解释它们

"<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />"
“”

这是正确的javascript、unicode编码。将它插入html/DOM就可以了


这是正确的javascript、unicode编码。将它插入html/DOM就可以了


是插入的内容。正确,但缺少结束标记(/>)之前的/。奇怪。这很可能是浏览器/DOM操纵html,但您可以在问题中看到字符串末尾的/是插入的内容。正确,但缺少结束标记(/>)之前的/。奇怪。这很可能是浏览器/DOM操纵html,但您可以在问题的字符串末尾看到/
"<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />"