title: Using WebAPI In Another MVC Project Getting Error Is The origin 'http://localhost:3038' is not allowed
body: <p>I Have Created A WebAPI In MVC That Code Is Working Fine Am Trying To Use That Get Method In Another Project Of MVC With JQuery Function Call When Am Calling The Method Am Getting The Error is</p>
  
  <p><strong>The origin '<a href="http://localhost:3038" rel="nofollow noreferrer">http://localhost:3038</a>' is not allowed</strong></p>
  
  <p><strong>Jquery Code</strong></p>
  
  <pre><code>$(document).ready(function () {
  $.ajax({
      type: "GET",
      url: "http://localhost:63540/api/emp",
      data: "{}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (data) {
  
          for (var i = 0; i &lt; data.d.length; i++) {
              $("#tbDetails").append("&lt;tr&gt;&lt;td&gt;" + data.d[i].E_id + "&lt;/td&gt;&lt;td&gt;" + data.d[i].E_name + "&lt;/td&gt;&lt;td&gt;" + data.d[i].Designation + "&lt;/td&gt;&lt;td&gt;" + data.d[i].DepartmentName + "&lt;/td&gt;&lt;td&gt;" + data.d[i].E_doj + "&lt;/td&gt;&lt;td&gt;" + data.d[i].EmpType + "&lt;/td&gt;&lt;/tr&gt;");
          }
      },
      error: function (result) {
          alert("Error");
      }
  });
  });
  </code></pre>
  
  <p>I Have Enabled cors for WebAPI in Like in 
  WebApiConfig.cs file added config.EnableCors();</p>
  
  <p>And In API I added</p>
  
  <p>[EnableCors(origins: "<a href="http://localhost:63540" rel="nofollow noreferrer">http://localhost:63540</a>", headers: "<em>", methods: "</em>")]</p>
  
  <p>Even I Enabled CORS In API Am Getting Error,How can solve this?,
  Thanks.</p>