How can I pass two parameters with ajax and receive them in the Controller as parameters
public IHttpActionResult GetComplementoMateriaId(int id, int IdUnidad)
Update:
Well, it's actually a GET what I want to do, I work with pages .html, so what I do is that from a jqGrid table I select an element and pass the id of that element through the url, and what I'm trying to do is pass two variables by url or if you can pass from AJAX similar to what you sent me, and receive them in the controller something like this
[ResponseType(typeof(COMPLEMENTOMATERIA))]
public IHttpActionResult GetComplementoMateriaId(int id, int IdUnidad){
try{
List<COMPLEMENTOMATERIA> lstComplementoMateria = LGComplementoMateria.GetComplementoMateria();
List<COMPLEMENTOMATERIA> ComplementoMateria = lstComplementoMateria.FindAll(x => x.IdMateria == id);
List<COMPLEMENTOMATERIA> Complemento = ComplementoMateria.FindAll(x => x.IdUnidad == IdUnidad);
if (ComplementoMateria == null){
return NotFound();
}
}
}
to do a double query and get a list, but I need to receive two parameters in the controller so I can do that search