在web.config中添加如下代码

< system.webServer>  
     < httpProtocol> 
       < customHeaders> 
      < add name="Access-Control-Allow-Methods" value="OPTIONS,POST,GET"/> 
      < add name="Access-Control-Allow-Headers" value="x-requested-with"/> 
      < add name="Access-Control-Allow-Origin" value="*" /> 
    < /customHeaders> 
     < /httpProtocol> 
< /system.webServer>