views:

107

answers:

1

Hi all,

I'm posting the following to an asp.net [Webmethod] using jquery via the $.ajax method. I've trapped the data being sent over the wire.

{number:01502,numberTypeId:2,companyId:531}

I've break pointed inside the [Webmethod] and the number is being returned as 1502 even though the parameter type is string, I'm guessing this has something to do with the deserialisation.

Can anyone shed any light. ( I've tried wrapping it in quotes before transmission )

Thanks

+3  A: 

In JSON serialization, strings need to be delimited with double quotes:

{number:"01502",numberTypeId:2,companyId:531}

That's the issue.

David M
Cheers double quotes corrected my problem!Thanks.
RubbleFord
No worries. I answered before I read that you'd tried quotes, but presumably they had been single ones?
David M