Good morning.
I'm trying to send a request in ajax in jquery, but it returns me that error. Sequence contains no elements, I'm trying to present data in the bootgrid
public ParametrosPaginacao(NameValueCollection dados)
{
string chave = dados.AllKeys.Where(k => k.StartsWith("asc")).First();
string ordenacao = dados[chave];
string campo = chave.Replace("sort[", String.Empty).Replace("]", String.Empty);
CampoOrdenado = String.Format("{0} {1}", campo, ordenacao);
Current = int.Parse(dados["current"]);
RowCount = int.Parse(dados["RowCount"]);
SearchPhrase = dados["searchPhrase"];
}
public int Current { get; set; }
public int RowCount { get; set; }
public string SearchPhrase { get; set; }
public string CampoOrdenado { get; set; }
}
My ajax
$(document).on('click', '#contratos_vigentes', function () {
var Status = $('#Status option:selected').text();
var Gestor_Acc = $('#Gestor_Acc option:selected').text();
var Gestor_Retida = $('#Gestor_Retida option:selected').text();
$.ajax({
url: 'FiltrarEPaginar',
type: 'post',
dataType: 'json',
data: { status : Status, gestor_acc : Gestor_Acc, gestor_Retida : Gestor_Retida },
});
//window.location.href = "Contratos_Vigentes?status=" + Status + "&gestor_acc=" + Gestor_Acc + "&gestor_retida=" + Gestor_Retida;
});