CORS endpoints on asp.net Webforms [WebMethod] endpoints

后端 未结 6 1123
北海茫月
北海茫月 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:22

    For the web form, you can use

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

    instead of

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

    The first one works for old version of ASP.Net Web Form.

提交回复
热议问题