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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -