Asp.Net MVC CORS

Asp.Net MVC项目需要使用跨域访问,也就是运行CORS,可以在web.config中进行设置,方法如下:









通过添加自定义Access Control Allow Origin允许跨域访问。在IIS中的设置相同。参考https://enable-cors.org/server_iis7.html
如果仅希望指定网站可以访问,可以设置value值。

你可能感兴趣的:(Asp.Net MVC CORS)