How do I append a specific header to an HttpResponse by default from an ASP.NET web service? -
i have web service many methods. clients accessing service domain (which means have put cross-domain magic in here , there). found header can add response enables cross-domain ajax calls work (this made things work me on chrome browser).
to solve issue, paste this: httpcontext.current.response.appendheader("access-control-allow-origin", "*");
on every method in service. that's tedious , ugly, , wondering if knew more elegant way of having header in web service response default?
i found embarrassingly simple solution. web service class, stuck line mentioned in question class constructor.
Comments
Post a Comment