I ve been trying for the last 3 hours to get my autocompletetextbox working and tryed all sort of code. My Web service is working from wich I m actually fetching all the stuff but the jquery seems not to work, I m always getting the error when typing the first letter inside the textbox:

Here is the code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Fpz_simulation.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link rel="stylesheet" type="text/css" 
        /1.8/themes/base/jquery-ui.css" />

<script   type="text/javascript" src=

<script  type="text/javascript" src=
    <script type="text/javascript" >
        $(function () {
            $('#<%= txtStudentName.ClientID %>').autocomplete({
                source: function (request, response) {
                        url: "WebService1.asmx/GetNastavnik",
                        data: "{ 'searchTerm': '" + request.term + "' }",
                        type: "POST",
                        dataType: "json",
                        contentType: "application/json;charset=utf-8",
                        success: function (data) {
                        error: function (result) {
                            alert('There is a problem processing your request');
                minLength: 0
    <form id="form1" runat="server">

        <asp:TextBox ID="txtStudentName" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

I have also downloaded the jquery code and made a refference to it but that didn't work so I chose to get the code with the URL's above.

Nice one dude... Code is absolutely correct..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.