CORS endpoints on asp.net Webforms [WebMethod] endpoints

后端 未结 6 1164
北海茫月
北海茫月 2021-01-04 06:47

I am trying to add some [WebMethod] annotated endpoint functions to a Webforms style web app (.aspx and .asmx).

I\'d like to annotate those endpoints w

6条回答
  •  情深已故
    2021-01-04 07:09

    I recommend double-checking you have performed all steps on this page: CORS on ASP.NET

    In addition to:

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

    Also try:

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

    Try adding directly in web config:

    
       
         
           
           
         
       
    
    

    Failing that, you need to ensure you have control over both domains.

提交回复
热议问题