访问控制允许来源的ASP [英] Access-Control-Allow-Origin in ASP

查看:141
本文介绍了访问控制允许来源的ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DOM文件,该文件调用另一个域中的ASP文件(不是.NET)。
我怎样写访问控制允许原产地,在ASP?
访问控制允许来源是PHP,但我不能找到ASP语法,我只能找到它的ASP.NET

I have a "DOM" file that calls an ASP file ( NOT .NET ) on another domain. How do i write the "Access-Control-Allow-Origin" in ASP? Access-Control-Allow-Origin is for "PHP" but i cant find the syntax for ASP, i can only find it for ASP.NET

它工作正常,当我使用Internet Explorer,但在Chrome它说:对所请求的资源不访问控制允许来源标头present原产地'的 HTTP:// SOURCEDOMAIN因此'是不允许访问

It works fine when i use internet explorer but in Chrome it says "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://SOURCEDOMAIN' is therefore not allowed access. "

推荐答案

添加HTTP头成经典ASP是一个微不足道的过程中,响应对象有一个专门为方法为此,可以让你你想要的任何自定义标头添加到将被发送到时请求页面浏览器中的HTTP标头。

Adding HTTP headers into a Classic ASP is a trivial process, the Response object has a method specifically for this purpose that allows you to add any custom header you want into the HTTP Headers that will be sent to the browser when the page is requested.

该方法被称为的AddHeader()下面是一个例子;

The method is called AddHeader() here is an example;

<%
Call Response.AddHeader("Access-Control-Allow-Origin", "http://SOURCEDOMAIN")
%>


相关链接

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