如何实现“Access-Control-Allow-Origin"asp.net中的标题 [英] How to implement "Access-Control-Allow-Origin" header in asp.net

查看:14
本文介绍了如何实现“Access-Control-Allow-Origin"asp.net中的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 asp.net 中实现Access-Control-Allow-Origin"标头

Is it possible to implement "Access-Control-Allow-Origin" header in asp.net

推荐答案

来自 enable-cors.org:

ASP.NET 上的 CORS

如果您无权配置 IIS,您仍然可以通过 ASP.NET 添加标题,方法是在源页面中添加以下行:

If you don't have access to configure IIS, you can still add the header through ASP.NET by adding the following line to your source pages:

Response.AppendHeader("Access-Control-Allow-Origin", "*");

另见:配置IIS6/IIS7

这篇关于如何实现“Access-Control-Allow-Origin"asp.net中的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆