title: Retrieving data from WebMethod using Jquery Ajax in c#
body: <p>I have jquery variable which contains following value ..</p>
  
  <pre><code>var data = [['Vikas', 75], ['Sumit', 55], ['Rakesh', 96], ['Shivam', 123], ['Kapil', 34], ['Rana', 104]];
  </code></pre>
  
  <p>Now as per my requirement i need those values from server side code,for this i have written a webmethod in c#.</p>
  
  <pre><code>[WebMethod()]
  public List&lt;string&gt; getData()
  {
      List&lt;string&gt; dbdata = new List&lt;string&gt;();
  
      dbdata.Add("Vikas,200");
      dbdata.Add("Sumit,120");
      dbdata.Add("Rakesh,200");
      dbdata.Add("Shivam,500");
      dbdata.Add("Kapil,234");
      dbdata.Add("Rana,104");
  
      return dbdata;
  }
  </code></pre>
  
  <p>But this is not the correct format of the data what is there in local data.</p>
  
  <p>Here is my jquery ajax request..</p>
  
  <pre><code>               $("#getdata").on("click", function (e) {
                  e.preventDefault();
  
                  $.ajax({
                      type: "POST",
                      url: "WebService2.asmx/getData",
                      dataType: "json",
                      success: function (dbdata) {
                          //data = JSON.parse(dbdata);
                          data = dbdata;
                          alert(data);
                      }
                  });
              });
  </code></pre>
  
  <p>My webMethod response ..</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d1p1:type="q1:string"   xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"&gt;["LOCAL,200","STD,120","ISD,200","VOIP,500","INCOMING,234","INET,104"]&lt;/anyType&gt;
  </code></pre>