title: How to return JSON from ASP.NET .asmx?
body: <p>I have the following test method:</p>
  
  <pre><code>Imports System.Web
  
  Imports System.Web.Services
  
  Imports System.Web.Services.Protocols
  
  
  &lt;WebService(Namespace:="http://tempuri.org/")&gt; _
  
  &lt;WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&gt; _
  
  &lt;System.Web.Script.Services.ScriptService()&gt; _
  
  Public Class DemoService
   Inherits System.Web.Services.WebService
  
  &lt;WebMethod()&gt; _
  Public Function GetCustomer() As String
      Return "Microsoft"
  End Function
  
  
  End Class
  </code></pre>
  
  <p>Even with the ResponseFormat attribute added the response is still being returned as XML rather than JSON.</p>
  
  <p>Thoughts appreciated.</p>