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?

John K
  • 28,441
  • 31
  • 139
  • 229

1 Answers1

3

What does .d in JSON mean?

Community
  • 1
  • 1
joelt
  • 2,672
  • 2
  • 24
  • 32
  • +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? – John K Dec 10 '10 at 19:26
  • Well, if you want to change it real bad, you could modify the rendered response with an HttpModule, as indicated here: http://www.devx.com/vb2themax/Article/19901/0/page/3 – joelt Dec 11 '10 at 00:31
  • 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. – joelt Dec 11 '10 at 00:32
  • found a [link](http://encosia.com/never-worry-about-asp-net-ajaxs-d-again/) with little explanatation for the .d Encapsulation – sudhansu63 May 05 '15 at 11:58