title: CORS in ASP .NET MVC5
body: <p>I have a MVC project in which I have a couple of JSON controller methods I want to expose cross domain. Not the entire site, just these two methods.</p>
  
  <p>I basically want to to the exact thing stated in this post for cors:</p>
  
  <p><a href="http://enable-cors.org/server_aspnet.html">http://enable-cors.org/server_aspnet.html</a></p>
  
  <p>However, the problem is that I have a regular MVC project and not a WEB API, meaning, that I cannot follow the steps regaring the register </p>
  
  <pre><code>public static void Register(HttpConfiguration config)
  {
      // New code
      config.EnableCors();
  }
  </code></pre>
  
  <p>method since it is not present in my MVC project.</p>
  
  <p>Is there a way to use this library although it is a MVC project?</p>
  
  <p>I'm aware of that I can config this through web.config using:</p>
  
  <pre><code>&lt;httpProtocol&gt;
        &lt;customHeaders&gt;
          &lt;clear /&gt;
          &lt;add name="Access-Control-Allow-Origin" value="http://www.domain.com" /&gt;
        &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt;
  </code></pre>
  
  <p>But I don't want to expose all methods, and I want to specify more than one domain (2 domains) to have access to my methods...</p>