title: ASMX webservice - return JSON instead of XML
body: <p>I have a web service that contains one method:</p>
  
  <pre><code>[WebMethod]
  public string Movies()
  {
      using (var dataContext = new MovieCollectionDataContext())
      {
          var query = dataContext.Movies.Select(m =&gt;new{m.Title,m.ReleaseDate}).Take(20);
          var serializer = new JavaScriptSerializer();
          return serializer.Serialize(query);
      }
  }
  </code></pre>
  
  <p>The method properly serializes the object, but when I view the response in FireBug, it looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;string xmlns="http://tempuri.org/"&gt;[{"Title":"SQL","ReleaseDate":"\/Date(1224007200000)\/"},{"Title":"Termonator Salvation","ReleaseDate":"\/Date(1224007200000)\/"}]&lt;/string&gt;
  </code></pre>
  
  <p>Here is jQuery method in which I use Kendo Data Source </p>
  
  <pre><code>$(function () {
      alert("Welcome To Kendo");
      var dataSource = new kendo.data.DataSource(
                  {
                      transport: {
                          read: {
                              type: "POST",
                              dataType: "json",
                              url: "/MovieService.asmx/Movies"
                             // contentType: "application/json; charset=utf-8"
  
                          }
                      },
                      change: function (e) {
                          alert(e);
  
                      },
                      error: function (e) {
                          alert(e[2]);
                      },
                      pageSize: 10,
                      schema: {
                          data: "d"
  
                      }
  
  
                  });
  
      $("#MovieGridView").kendoGrid({
          dataSource: dataSource,
          height: 250,
          scrollable: true,
          sortable: true,
          pageable: true,
          columns: [
              { field: "Title", title: "Movie Name" },
              { field: "ReleaseDate", title: "Movie Release" }
              ],
          editable: "popup",
          toolbar: ["create"]
      });
  });
  </code></pre>
  
  <p>The above code show what I am doing in jQuery and when the error event call I got this error</p>
  
  <pre><code>SyntaxError: JSON.parse: unexpected character
  </code></pre>
  
  <p>How can I convert the above data into JSON so I can use it in jQuery? And where am I going wrong?</p>