Wednesday 15 June 2011

asp.net - Cannot Iterate through JSON object given from code behind -


I am trying to read JSON data that is given at the back of the code function. I set this up:

Back code:

  & lt; WebMethod () & gt; Public sharing function LoadVolgNummer (Try not as as a string ByVal EnqDGId, Volt Volgordaiaidi) as string Dim Oarset value EnqueteVraag = Some oRetValue = EnqueteDetail.LoadQuestion (EnqDGId, VolgordeId) Akspasn Report Catch in (formerly, message, GetCurrentMethod.Name) try the end slow serializer string = Serialize as the new CSAsilizer = JSON.Serialize (oRetValue) .ORRA Return JSON Sam This is the JSON string returning from my function:  
  {"questionid": 1, "question": "dxtverlanning van xxx in JAQUERY on page:  
  $. Ajax ({type: "post", url: "enquete.aspx / loadVolgNummer", data: JSON.stringify ({EnqDGId: '1', Volgordide: '1'}), Content Type: "App / Jason; Charset = Utf-8 ", data type:" jason ", success: function (msg) {warning (msg. Question);}, error: work () {warning (failure to load volgammer in loading)}});   

Enquetevraag class:

  Public class EnqueteVraag as a public query in the form of an integer public query string   

Termination class

The result is success but I can not just read the data in jQuery. This shows me 'undefined'

Case closed to Felix King and thanks January Dvorak!

JSON.parse (msg.d). Question

No comments:

Post a Comment