title: How to pass a JSON array in javascript to my codebehind file
body: <p>I am getting a JSON object in my javascript function in aspx page. I need to fetch this data from my code behind file. How can I do it?</p>
  
  <p>My javascript function is : </p>
  
  <pre><code> function codeAddress() 
      {
          var address = document.getElementById("address").value;
          var geocoder = new google.maps.Geocoder();            
          geocoder.geocode({ 'address': address }, function(results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  map.setCenter(results[0].geometry.location);
                  var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location });
              }
              else {
                  alert("Geocode was not successful for the following reason: " + status);
              }
  
              var requestParameter = '{' +
                          'output:"' + results + '"}';
  
              $.ajax({
                  type: "POST",
                  url: "Default.aspx/GetData",
                  data: requestParameter,
                  //contentType: "plain/text",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function(msg) {
                      alert(msg.d);
  
                  }, 
                  error: function() { alert("error"); } 
              });
  
          });
      }
  
  
     Default.aspx.cs
  
   [WebMethod]
  public static string  GetData( Object   output) 
  {
      return output.ToString();
  }
  </code></pre>
  
  <p>I am getting the output as an array of objects instead of the actual result -   [object Object],[object Object],[object Object] .Please provide me a solution to get the actual result.  The JSON I am working on is given below 
  <a href="http://maps.googleapis.com/maps/api/geocode/json?address=M%20G%20Road&amp;sensor=false" rel="nofollow">http://maps.googleapis.com/maps/api/geocode/json?address=M%20G%20Road&amp;sensor=false</a></p>