Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am getting an error when calling asp.net mvc action method returning a JsonNetResult. using the following code for that.

This is what I see in the response body. for some reason it is struggling with the < and > text.

{
    "archivedEmailsData":[
          {
            "Id":294455,
            "Date":"2009-09-10T15:20:00",
            "Subject":"Testing fix in 2.20.8.0 - quotes or single 'quote' and char < and="">"
          }]
}

original text of object Subject "Testing fix in 2.20.8.0 - quotes or single 'quote' and char < and >" string

using angularjs to make the call but I get the same thing when using jquery.

share|improve this question
add comment

1 Answer

Your JSON is invalid and should look like the following:

{
    "archivedEmailsData": [
        {
            "Id": 294455,
            "Date": "2009-09-10T15:20:00",
            "Subject": "Testing fix in 2.20.8.0 - quotes or single 'quote' and char < and >"
        }
    ]
}
share|improve this answer
    
Why is it getting serialized improperly? Not sure if it something with the content type maybe or formatting setting. –  user1159308 18 mins ago
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.