Hi
I am using the code you gave me before, this time I want to do the same search with different criteria but in a different folder than my root, below is my code and error I am getting, also my folder structure
Schools/Towns/NorthWest/NorthWest.aspx with subfolders
<script type="text/javascript">
$(function () {
$("[id$=txtSearch]").autocomplete({
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/Towns/NorthWest/NorthWest.aspx/GetCustomers")%>',
data: "{ 'prefix': '" + request.term + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('-')[0],
val: item.split('-')[1]
}
}))
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
select: function (e, i) {
var selectedValue = i.item.label.trim();
$.ajax({
url: '<%=ResolveUrl("~/Towns/NorthWest/NorthWest.aspx/GetLink")%>',
data: "{ 'selected': '" + selectedValue + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
document.location.href = data.d;
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
minLength: 3
});
});
</script>
When I type Bri and select Brits it give me the following error
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Schools/Towns/NorthWest/Towns/NorthWest/Brits/Brits.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237