ASP.NET JSON Web服务为什么返回结果'D'? [英] Why do ASP.NET JSON web services return the result in 'd'?
问题描述
我写了使用JSON编码一些ASP.NET Web服务,一拉:
I wrote some ASP.NET web services that use JSON encoding, a la:
[WebInvoke()]
[OperationContract]
public int SetInformation(int recordid, string data)
{
return 42;
}
和返回的JSON是:
{"d": 42}
为什么参数命名 D
?我可以控制吗?再说了,到电子
?
Why is the parameter named d
? Can I control that? Say, to e
?
有关参考,有几个类似的问题,我终于能够挖掘:
For reference, a few similar questions I've finally been able to dig up:
- 是什么在JSON .D是什么意思?
- How改变ASP.NET的WebMethod的D标识符JSON响应,为不同的名字呢?
- Returning从JSON Web服务的HTML - 什么是" .D" ?
- What does .d in JSON mean?
- How to change ASP.NET WebMethod's 'd' identifier in a JSON response, to a different name?
- Returning HTML from JSON webservice - what is the ".d" ?
推荐答案
这是一个安全的功能,$ P $从能够直接执行一个eval语句中的javascript返回pvents的JSON。或东西沿着这些路线非常相似。
This is a "security" feature that prevents the JSON from being returned from being able to be directly executed javascript inside an Eval statement. Or something very similar along these lines.
更多信息:<一href=\"http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/\">http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/看看标记服务员的部分,有一个在我的味精汤.D!
这篇关于ASP.NET JSON Web服务为什么返回结果'D'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!