asp.netMVC解决ajaxs跨域问题

作者:自由 2020/12/10 19:01:14
asp.netMVC解决ajaxs跨域问题

在web.config中的<system.webServer>接点下面配置

<system.webServer>
    <httpProtocol>
          <customHeaders>
            <clear />
            <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>
     <directoryBrowse enabled="true" />
  </system.webServer>

 

跨域

C#跨域问题

跨域怎么解决

评论: