如何更改 ASP.NET WebMethod 的“d” JSON 响应中的标识符是否具有不同的名称?

发布于 2024-10-07 05:29:44 字数 484 浏览 0 评论 0原文

这是可行的:通过 jQuery,我使用 jQuery.ajax(..) 调用页面例如 Default.aspx/GetStatus 具有 WebMethod 属性:

// Default.aspx
[WebMethod()]
static public bool GetStatus(long id)
{ //...

JSON 响应包含格式为 { d: true } 的正确布尔值。但是我不明白由此产生的“d”成员名称的起源。
“d”标识符从何而来(如何决定)以及如何更改其名称?

This works: through jQuery I'm using a jQuery.ajax(..) call to a page e.g. Default.aspx/GetStatus having a WebMethod attribute:

// Default.aspx
[WebMethod()]
static public bool GetStatus(long id)
{ //...

The JSON response contains the correct boolean value in the format { d: true }. However I don't understand the origin of the resulting "d" member name.
Where does the "d" identifier come from (how is it decided) and how can I change its name?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文