0
I need that when textbox loses focus, pass the value you have in it to my controller, in my controller I will return an object to jquery, so I can fill in the other fields.
I wonder how I could do that?
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 this way:
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) {
}
});
}
You can do it using Ajax. Return a Json and fill in. Post the html and Jquery you’ve been trying to use.
– Marconi
You only have this code?
– PauloHDSousa