2016-09-14 65 views
1

我已经开发了asp.net web表单应用程序,我需要调用跨域处理程序,所以为此我需要'启用CORS',但我对此不知道。 我已经使用mvc'启用CORS',但没有使用网页表单应用程序,请提供适当的建议。 预先感谢您如何在asp.net web表单应用程序中启用CORS?

+0

这里是你的答案http://stackoverflow.com/questions/35627648/cors-endpoints-on-asp-net-webforms-webmethod-endpoints –

回答

0
<httpProtocol> 
    <customHeaders> 
     <add name="Access-Control-Allow-Methods" values="*" /> 
     <add name="Access-Control-Allow-Headers" values="Content-Type" /> 
    </customHeaders> 
<httpProtocol> 

写这个代码在web.config文件在您的应用程序的根。

+0

感谢您的回复。 我已经根据您的建议设置了配置,但是当我设置 身份验证模式是配置文件中的Forms时,则它不起作用。 ' <授权>' 请给我建议 –

相关问题