C# iis 网站 跨域

在web.config中配置:

<?xml version="1.0" encoding="utf-8"?>
<!--
  有关如何配置 ASP.NET 应用程序的详细消息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
        <customErrors mode="Off"/>
    </system.web>
<system.webServer>
 <httpProtocol>
  <customHeaders>
  <add name="Access-Control-Allow-Methods" value="OPTIONS,POST,GET"/>
  <add name="Access-Control-Allow-Headers" value="x-requested-with,content-type"/>
  <add name="Access-Control-Allow-Origin" value="*" />
  </customHeaders>
 </httpProtocol>
 </system.webServer>

</configuration>

转:http://www.jb51.net/article/113644.htm

猜你喜欢

转载自blog.csdn.net/u013751758/article/details/79986150