How to change ASP.NET WebMethod's 'd' identifier in a JSON response, to a different name?
Asked Answered
C

1

1

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?

Counterfactual answered 10/12, 2010 at 19:15 Comment(0)
I
3

What does .d in JSON mean?

Infinitive answered 10/12, 2010 at 19:24 Comment(4)
+1 That's awesome - I laughed at "well it had to be something". So that answers half the question, which I can live with. Do you have any idea how to change it?Counterfactual
Well, if you want to change it real bad, you could modify the rendered response with an HttpModule, as indicated here: devx.com/vb2themax/Article/19901/0/page/3Infinitive
Or you could wrap all your calls to the service with a JavaScript function that creates a new property. Neither of which sounds like a great idea.Infinitive
found a link with little explanatation for the .d EncapsulationStirling

© 2022 - 2024 — McMap. All rights reserved.