Como adicionar o Access-Control-Allow-Origin?
Estou recebendo o seguinte erro quando eu chamo meu método de serviço da web.
Origin http://localhost:4165 is not allowed by Access-Control-Allow-Origin.
Ao referir net eu estou recebendo solução como adicionarAccess-Control-Allow-Origin
Eu não sei onde adicionar isso. Meu script é:
$(document).ready(function () {
$.ajax({
type: "Post", dataType: "json", contentType: "application/json; charset=utf-8",
url: "http://localhost:63384/ListWebService.asmx/HelloWorld", success: function (data) { alert(data.d); }, error: function (request, status, error) {
alert(request.responseText);
}
});
});
E meu método de serviço da web é:
[WebMethod]
public string HelloWorld()
{
return "Hello User";
}