标签:action attribute style bsp base context class nat web api
using System; using System.Web.Http.Filters; public class AllowCrossSiteJsonAttribute : ActionFilterAttribute { public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { if (actionExecutedContext.Response != null) actionExecutedContext.Response.Headers.Add("Access-Control-Allow-Origin", "*"); base.OnActionExecuted(actionExecutedContext); } }
标签:action attribute style bsp base context class nat web api
原文地址:http://www.cnblogs.com/gaocong/p/6224448.html