Hi, I have a web service that creates an event, I use a form to call it. But the routing on Visual Studio is not working.
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
<p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>
</div>
<div>
<input type="text" id="nombreEvento" placeholder="Nombre del evento"/>
<input type="text" id="capacidad" placeholder="Capacidad" />
<input type="button" value="Enviar" onclick="add();"/>
</div>
<script src="ajax.aspnetcdn.com/.../jquery-2.2.4.js"></script>
<script>
function add() {
var nombre = $('#nombreEvento').val();
var capacidad = $('#capacidad').val();
if (nombre != "") {
var Evento = {
Nombre: nombre,
Capacidad: capacidad
};
var info = JSON.stringify(Evento);
$.get('localhost/.../Values', info , function (data) {
alert("El Evento ha sido creado");
location.reload();
});
}
else {
alert("Todos los campos son obligatorios");
}
}
</script>
I have two arguments
[Route("api/Values/Nombre/{id}/Capacidad/{iCapacity}")]
//[Route("api/{Nombre: id}/{Capacidad: iCapacity}")]
public HttpResponseMessage Get(string id, int iCapacity)
{