Would you like to know how I could do this?
My controller method is this:
public UserValid RetornaUsuario(String matricula)
{
UserValid valid = new UserValid();
UserValidDAO dao = new UserValidDAO();
valid = dao.Busca(matricula);
return valid;
}
I was trying to do something like this:
function PassarMatricula() {
var parametros = {
_matricula : $('#txtMatricula').val(),
};
$.ajax({
url : 'Home/RetornaUsuario',
datatype : 'json',
contentType : "application/json; charset=utf-8",
type : "POST",
data : JSON.stringify(parametros),
success : function(data) {
},
error : function(error) {
}
});
}