I have this script:
$('#Musico').change(function () {
var id = $(Musico).val();
var url = '@Url.Action("Votar","Chamada")';
var tipo = 1;
$(function ChamaVotar() {
$.post(url, { id: id, tipo: tipo });
});//Function ChamaVotar
});//musico change
And this controller:
public ActionResult Votar(int id, int tipo)
{
if (tipo == 1)//Tipo Musico
{
var chamadaMusicas = db.ChamadaMusicas.Include(c => c.Chamada).Include(c => c.Musica).Where(c => c.Chamada.PessoaID.Equals(id)).Where(i => i.Chamada.Ativa.Equals(true)).ToList();
return View(chamadaMusicas);
}
else//Local
{
var chamadaMusicas = db.ChamadaMusicas.Include(c => c.Chamada).Include(c => c.Musica).Where(c => c.Chamada.LocalID.Equals(id)).Where(i => i.Chamada.Ativa.Equals(true)).ToList();
return View(chamadaMusicas);
}
}
I need to, when I pass my parameters to the controller, the view is opened. But it is not opening ... The controller receives the information but does not open the page. What solution to this?