I want to submit a form using AJAX to an MVC 3 controller.
The form and controller are in two different domains, so I want to use CORS.
I read that the following code should do the trick in ASP.NET:
Response.AppendHeader("Access-Control-Allow-Origin", "*");
from http://enable-cors.org/#how-asp.net
Should this code go directly to the controller that accepts the form data? As far as I know, there needs to be some kind of data exchange between the client and server hosting data to determine if CORS / is supported or not, so I think that one line of code should go somewhere else?
thanks
Kenci
source share