Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/23.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
C# 使用as3 URLLoader从ASP.NET MVC控制器加载数据_C#_Asp.net Mvc_Actionscript 3 - Fatal编程技术网

C# 使用as3 URLLoader从ASP.NET MVC控制器加载数据

C# 使用as3 URLLoader从ASP.NET MVC控制器加载数据,c#,asp.net-mvc,actionscript-3,C#,Asp.net Mvc,Actionscript 3,ASP.NET控制器: // GET api/assets/5 public string Get(int id) { ... <some DB init here> string sResult = (string)oCmd.ExecuteScalar(); return sResult; } 现在我尝试将字符串解析为XML,但得到的只是错误:“error#1090:XML解析器失败:元素格式不正确。” 我发现,当我在“watch Expression”中

ASP.NET控制器:

// GET api/assets/5
public string Get(int id)
{
    ... <some DB init here>
    string sResult = (string)oCmd.ExecuteScalar();
    return sResult;
}
现在我尝试将字符串解析为XML,但得到的只是错误:“error#1090:XML解析器失败:元素格式不正确。”

我发现,当我在“watch Expression”中查看oUrlLoader.data时,该值存在,但sData=oUrlLoader.data=“”(空字符串?)

还尝试了oUrlLoader.data.toString()-没有帮助,但是watch表达式发生了一些变化,没有toString(),它在求值中有两个“”符号,而toString()只有一个“”

知道为什么在监视表达式值中设置了oUrlLoader.data,但代码中的相同oUrlLoader.data不返回任何字符串吗?

另外,这实际上是字符串值(SVG图像),而不是二进制数据。我正在使用Flash Builder for as3

编辑:

呵呵,sData在Watch表达式中也有一个值。数据是:

"<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.2\" id=\"svg2\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><circle cx=\"284\" cy=\"310\" r=\"150\" id=\"untitled\" transform=\"matrix(1,0,0,1,-37,-22)\" style=\"opacity:1;stroke:#44F247;fill:#F087CA;fill-opacity:1;stroke-opacity:0.54;stroke-width:35.1;stroke-miterlimit:3;stroke-linecap:none;stroke-linejoin:round;\"/></svg>"
“”
当我复制此数据并将其直接粘贴到代码中时,它可以工作,但使用此urlLoader则无法工作…:(

EDIT2:

生成器的屏幕截图(当鼠标悬停时,观察表达式有值,代码中有数据):


还有…:]此字符串在源数据库中不包含任何制表符、新行或其他空格…

问题在于从服务器检索到的数据/文本。它充满了反斜杠。当直接在代码中写入文本时,它可以作为转义符使用,但不应该出现在检索到的数据中。

谢谢,这就是我t!:D我已经将MVCAPI控制器更改为standart控制器,这确实有帮助,现在字符串不包含转义字符。
"<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.2\" id=\"svg2\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><circle cx=\"284\" cy=\"310\" r=\"150\" id=\"untitled\" transform=\"matrix(1,0,0,1,-37,-22)\" style=\"opacity:1;stroke:#44F247;fill:#F087CA;fill-opacity:1;stroke-opacity:0.54;stroke-width:35.1;stroke-miterlimit:3;stroke-linecap:none;stroke-linejoin:round;\"/></svg>"