title: passing coordinates to d3js from asp.net server side showing null
body: <p>I am working on data visualization on map using d3js. i was able to show the map which if i put static coordinates it'll show marker on map. but what i want to do is fetching coordinates from database and showing marker on the map, though passing the coordinates from the server side to d3js is where i'm having problem. i have gone through some questions relating to this which has really helped me so far but i'm stucked here as the method passed to d3js is showing null value.</p>
  
  <pre><code>    var width = window.innerWidth,
                  height = window.innerHeight;
  
              // create svg for viz
              var svg = d3.select("body")
                  .append("svg")
                  .attr("width", width)
                  .attr("height", height);
  
              // define JSON map data
              d3.json("NGA_adm2_conv.json", function (json) {
                  // create a first guess for the projection
                  var center = d3.geo.centroid(json);
                  var scale = 3000; //150;//8000;
                  var offset = [width / 2, height / 2];
  
                  var projection = d3.geo.mercator()
                      .center(center)
                     // .rotate([85.8, 0])
                      .scale(scale)
                      .translate(offset);
  
                  var geoPath = d3.geo.path()
                      .projection(projection);
  
                  svg.append("g")
                      .selectAll("path")
                      .data(json.geometries)
                      .enter()
                      .append("path")
                      .attr("d", geoPath)   
                      .attr("class", "areas")
                      .attr("fill", "Steelblue");
                  // Create data for circles:
  
                 //passing method to var marker then to d3
                  var markers = '&lt;%= JasonGet() %&gt;';
                  // Add circles:
                  svg
                    .selectAll("myCircles")
                    .data(markers)
                    .enter()
                    .append("circle")
                      .attr("cx", function (d) { return projection([d.longitude, d.latitude])[0] })
                      .attr("cy", function (d) { return projection([d.longitude, d.latitude])[1] })
                      .attr("r", 4)
                      .style("fill", "69b3a2")
                      .attr("stroke", "#69b3a2")
                      .attr("stroke-width", 2)
                      .attr("fill-opacity", .4)
  
              });
  
  
  //below is my asp.net c# code for fetching coordinates from database 
  
      public string jsonString = "";
              [WebMethod]
              public string JasonGet()
              {
                  var queryWithForJson = "SELECT  latitude, longitude FROM tblCoordinates FOR JSON AUTO";
                  var conn = new SqlConnection(connetionString);
                  var cmd = new SqlCommand(queryWithForJson, conn);
                  conn.Open();
                  var jsonResult = new StringBuilder();
                  var reader = cmd.ExecuteReader();
                  if (!reader.HasRows)
                  {
                      jsonResult.Append("[]");
                  }
                  else
                  {
                      while (reader.Read())
                      {
                          jsonResult.Append(reader.GetValue(0).ToString());
                      }
                  }
                  Label1.Text = jsonResult.ToString();
                 return (new JavaScriptSerializer()).Serialize(jsonResult);
              }
  </code></pre>