Please Help!
I am trying to use a Web Service (ASMX) file. When i view this and query it the page returns exactly what I want. So that page seems to be fine.
The issue is I'm trying to add an auto-complete to a textbox in my ASP.NET application but it doesn't seem to be doing anything! I've included all the relevant JQuery files (jquery-ui.js, jquery-ui-css, query-1-11.2.min.js) in my Site.master file.
Within my page i've included the Javascript to do the autocomplete.
Can anyone point my in the right direction? I'm still using IE8...
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
$(document).ready(function () {
$('#txtAutoFill').autocomplete({
minLength: 2,
source: function (request, response) {
$.ajax({
url: 'UserList.asmx/GetAutoCompleteData',
method: 'post',
contentType: 'application/json;charset=utf-8',
//data: JSON.stringify({ username: request.username }),
data: request.username,
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
}
});
});
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentPH" runat="server">
<h1 id="h01"></h1>
<asp:TextBox ID="txtAutoFill" runat="server" CssClass="form-control"></asp:TextBox>
</asp:Content>