title: Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method
body: <p>I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com.</p>
  
  <p>If I try to call it, I get the expected...:</p>
  
  <pre><code>Origin http://someothersite.com is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>I know of two ways to get around this: <a href="https://stackoverflow.com/questions/5968682/jquery-ajax-json-cross-domain-request-and-asp-net-mvc">JSONP</a> and creating a <a href="http://tpeczek.blogspot.com/2010/09/httphandler-with-cross-origin-resource.html" rel="noreferrer">custom HttpHandler</a> to 
  set the header.</p>
  
  <p>Is there no simpler way?</p>
  
  <p>Is it not possible for a simple action to either define a list of allowed origins - or simple allow everyone? Maybe an action filter?</p>
  
  <p>Optimal would be...:</p>
  
  <pre><code>return json(mydata, JsonBehaviour.IDontCareWhoAccessesMe);
  </code></pre>