title: sharepoint 2010 use list items as JSON data and consume it in ajax
body: <p>I'm new to sharepoint.I want to create a json format of a list data and consume it by ajax.I know how to iterate through list items:</p>
  
  <pre><code>SPList list = SPContext.Current.Web.Lists["My List"]; 
  
  foreach (SPListItem item in list.Items) 
  { 
      //process
  }  
  </code></pre>
  
  <p>How can I use this to return result as json and use this result in ajax?</p>