Click here to Skip to main content
15,917,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've received a JSON array from a webmethod. How to handle JSON array in asp.net? Please give an example as I'm new to JSON. (Actually I want to populate the values of the JSON array in a dropdown list. Thanks in advance
Posted
Updated 23-Jun-13 22:13pm
v2

Go throuh the below link, this may helps you

http://www.java2s.com/Code/CSharp/Network/JsonStringToByteArray.htm[^]

Thnaks
--RA
 
Share this answer
 
Comments
sunpop 24-Jun-13 4:07am    
Thank you, but I want to handle JSON ARRAY. Please help
With the help of JQuery I've achieved it

C#
var jsonArr = $("#jsonOutput").val();
   if (jsonArr.toString() != "")
    {  var stType = JSON.parse(jsonArr2);
       var strType = $('#strType');
       strType.append($('<option></option>').val('0').html('--Select--'));
       for (i = 0; i < stType.response_list.length; i++) {
           strType.append($('<option></option>').val(stType.response_list[i].code).html(stType.response_list[i].label));
       }
   }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900