I am not able to get the value of the input text, the error of indefinite ... someone would know to answer me because this is so ???
$(document).ready(function () {
$('#btnPesquisar').click(function () {
var x = $("#txtMatriculaPesquisar");
alert(x.val());
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: 'Aluno.aspx/BuscaAluno',
data: "{'matircula':'" + matricula + "'}",
async: true,
dataType: "json",
success: function (result) {
if (result != null) {
$.each(result.d, function (key, value) {
$('#txtNome').value = value.Nome;
$('#txtMatricula').value = value.Matricula;
$('#txtCpf').value = value.Cpf;
$('#txtNascimento').value = value.Data;
});
}
},
});
});
});
<div class="row">
<div class="input-group col-md-6 col-md-offset-1">
<input type="text" class="form-control" placeholder="Digite a Matricula" id="txtMatriculaPesquisar" value="" runat="server"/>
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="btnPesquisar">Pesquisar</button>
</span>
</div>
</div>