.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

jQuery Autocomplete with WebService

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net


I am using the jQuery autocomplete. I get the data bu a WebService. I pretty sure that the WebService return the good value (I checked it with a breakpoint and with firebug's console).

This is the javascript code:

$(document).ready(function() {
        type: "POST",
        url: "WebService.asmx/GetClientFromDb",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        sucess: function(data) {
                source: data,
                minLength: 0
        error: function() {
            alert("Error in WebService");

The alert box is not fired so I guess the WebService call is a sucess. If someone see my mistake, let me know



View Complete Post

More Related Resource Links

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


build repository from SQL 2005? for a Linq, Jquery autocomplete



  I have the a question am going about his correctly I have a database for categories, it has many fields and about 4000 records,  but with a Jquery autocomplete needing speed and the fact that I only need to return a key and category name. I did the following:  (oh just to note, MVC2, Ajax project)


    public class categorySearch
        public Guid Category_GUID { get; set; }
        public string Category_Name { get; set; }


and now for the repository

    public class categoryRepository
        internal List<categorySearch> FindCategory(string searchText, int maxResults)
            List<categorySearch> category = new List<categorySearch>();
            dbWebEntities storedb = new dbWebEntities(); 

            var getcat = storedb.Categories.ToList();

            foreach (var item in getcat)
                category.Add(new categorySearch { Category_GUID = item.Cat_GUID, Category_Name = item.Category_Name});

            var result = from c in category
                         where c.Category_Name.Contains(searchText)
                         orderby c.Category_Name

Writing Data to database with jQuery Forms, ASMX Webservice, & JSON - help!



Can someone point me in the right direction on how to submit data from a jQuery form to a ASMX webservice? I have gotten everything on the form ready to be submitted to the database and now I am stuck on how to send it over using $.ajax(). Everything I have read tells me how to get data from a webservice and display it with jQuery, but not the other direction nor how to access the json data within the within the webservice service(similar to a Request.Form approach with ASP.NET forms).

In other words: 

1. What do I need to do to my webservice to make sure it can receive data from the jQuery form. 

2. What do I need to do in jQuery to receive an acknowledgement the save on the server side was successful. 

I can explain more if need be, but if there is a comprehensive tutorial on not only reading, but also WRITING data with jQuery, JSON, etc. I would love to get pointed in that direction. 

jquery autocomplete selected value



Iam using jquery autocomplete to search data and i have button to get the detail value of employee and

display in label , what i need is that , i don't want to put button to get detail , instead i need to select the from\

auto search and press enter key  and show the detail in the lablel example(empname,address, emailid).

Looking forward valuable suggestions

Calling a webservice in MVC using jquery works on dev box not prod box


I have a webservice that is part of the MVC project.  I am using VS 2010 MVC 2.0 on Windows 7.  When I run the web application locally the webservice call works flawlessly, however on the prod box using  2008 upgraded with asp.net 4.0 it fails.

I get an error "The controller for path '/services/traxservices.aspx/upDateCustomer' was not found or does not implement IController. "

Is there some type of issue with the settings in the global.ascx or in IIS that I am missing?


Any help would be appreciated.

jQuery UI Autocomplete, Web Services and JSON

Hi guys, this is my first post, I´m desperate after wasting 2 days in google and reading forums ans sites. I can´t make it work. I just want to provide the name of cities to show in the autocomplete plugin. Let´s go part by part:WEB SERVICE: I use the Json.Net component to serialize a datasetpublic string ConsultTable(string data) { SqlConnection connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["SqlServerConnection"].ToString()); SqlCommand command = new SqlCommand("SELECT name FROM cities",connection); connection.Open(); DataSet dataset = ToDataSet(command.ExecuteReader()); Newtonsoft.Json.JsonSerializer json = new Newtonsoft.Json.JsonSerializer(); json.NullValueHandling = NullValueHandling.Ignore; json.ObjectCreationHandling = Newtonsoft.Json.ObjectCreationHandling.Replace; json.MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore; json.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; json.Converters.Add(new DataSetConverter()); StringWriter sw = new StringWriter(); Newtonsoft.Json.JsonTextWriter writer = new JsonTextWriter(sw); writer.Formatting = Formatting.None; writer.QuoteChar = '"'; json.Se

ashx handler using jquery autocomplete

Hi, i have using jquery for autocompelete option and iam using ashx file , i have 2textbox  , i need to show diffrent search record in the text box, iam using 2 ashx file to show the value using jquery, i want to user single ashx file instead of iam using 2 ashx handle filercan use switch case to handle this , i want to use 7textbox  all textbox i need to do autosearch, how to handlethis senario using jquery and ashx handler file below the code this is my codebehind query clsquery.updatetablestring = "select top 2 Cont_number from ASPrearrival_list where Cont_number";         clsquery.updatetablestring = "select top 2 custid,custname from ASCustomer where custname"; // this is my auto search iam using 2 handler file , i wants only one handler instead of 2handler <script type="text/javascript" src="jquery.autocomplete.js"></script>      <script type="text/javascript">       $(document).ready(function()       {                       $("#<%=txtcontno.ClientID%>").autocomplete("Handler1.ashx");           $("#<%=txtcname.ClientID%>&q

How to access webservice using Jquery

Hi to all   I have some queries regarding accessing web service deploy on another server.  I have two project both on same machin under same solution.One is my webservice and another inculde my webproject that access that webservice using jquery .I am using flexigrid control to populate my data.it is working fine when i am trying to use the webservice on my machin under same solution but when i try to use webservice reside on another machin it not working for me.This is my aspx page<script type="text/javascript"> $(document).ready(function() { var SessionUserID = ('<%=Session["UserId"].ToString()%>').val; var myDate = new Date(); var prettyDate = myDate.getDate() + '/' + (myDate.getMonth() + 1) + '/' + myDate.getFullYear(); $("#<%= txtAuctionDate.ClientID %>").val(prettyDate); $("#<%=txthiddenDate.ClientID %>").val(prettyDate); $("#flex1").flexigrid ( { url: 'http://localhost:2158/TWWebService.asmx/getBuyerDealBook', dataType: 'xml', colModel: [ { display: 'LotNo', name: 'LotNo ', width: 120, sortable: true, align: 'left', hide: false }, { display: 'DealNo', name: '

jquery webservice with parameter

how to call web service with jquery in asp.net with param valuethanks in advance

jQuery / javascript calling a webservice


I've tried a bunch of different examples and still can't get this to work.

I have a jQuery GalleryView control I'm using and I simply want to log impressions.  I set up a webservice that works, but I can't figure out how to get it to work in javascript.  I have verified that the webservice is working as expected.

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptServ

Unable to get to the webservice using ajax POST jQuery



I need to pass a customer id to get some data back for a customer from a webservice. I can't figure out how to get to the webservice, I have a breakpoint set in the webmethod but it's not being hit and the alert box is not popping up either.  For a test I am just trying to show some value from the returned data in an alert box.  Note I am just hard coding the customer id of 1001. The webmethod takes a parameter of string customerid.

//Webmethod code:

        public customer fetchcustomer(string customerid)
            customerDL custDL = new customerDL();
            return custDL.getData(customerid);



//jQuery code:
   $(document).ready(function() {

            type: "POST",
            contentType: "application/json; charset=utf-8",

JQuery Autocomplete Call WCF Service Method


I am trying to use the below code to call a wcf service method for Autocomplete functionality in a TextBox.  I have written the following query:

$(document).ready(function () {
            $("#<%= txtCompany.ClientID %>").autocomplete(http://localhost/PieScore/PieScore.Application.Services/EmployeeService.svc/GetTestCompanyList, {
                dataType: 'json',
                parse: function (data) {
                    var items = data.d;
                    var parsed = [];
                    for (var i = 0; i < items.length; i++)
                        parsed[i] = {

jquery autocomplete not firing




iam using jquery auto complete for ,but its not firing handlerold.ashx file,

pls give valuable suggestions

script type="text/javascript">
//      $(document).ready(function()
//      {
        $("#<%=txtguages.ClientID%>").autocomplete('Handlerold.ashx',{minChars:1,extraParams:{"param1":"1"}}).result(function (event, data, formatted) {
        if (data) {
            alert('Value: '+ data[1]);
            $("#<%= Hdnguages.ClientID %>").val(data[1]);
        else {
            $("#<%= Hdnguages.ClientID %>").val('-1');

handlerold.ashx code below

<%@ WebHandler Language="C#" %>

using System;
using System.Web;
using vdatalayer;
using System.Data.SqlClient;
using S

jquery autocomplete



has anyone ever tried jquery multiple autocomplete (http://jqueryui.com/demos/autocomplete/#option-source ). How do I filter itbased on the first char?so instead of '%_%' it will be '_%'


jquery autocomplete does not show


Hi all

im trying to get a autocomplete with jquery

this is what i  have:


<%@ WebHandler Language="VB" Class="cityAutoComplete" %>

Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Text

Public Class cityAutoComplete : Implements IHttpHandler
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Dim clDb As New myClassDb
        Dim prefixText As String = context.Request.QueryString("q")
        Dim sql As New SqlCommand
        sql.Connection = clDb.getConnection
        sql.CommandText = ("select CityName, CityId from tblCityVariant where " & _
                           "CityName like @SearchText + '%'")
        sql.Parameters.AddWithValue("@SearchText", prefixText)
        Dim sb As StringBuilder = New StringBuilder
        Dim sqlReader As SqlDataReader = sql.ExecuteReader

        While sqlReader.Read
            sb.Append( & sqlReader.Item(0)).Append(Environment.NewLine)
        End While

    End Sub
    Public ReadOnly Property IsReusable() As Boo

JQuery autocomplete and non english characters


I have implemented the jquery autocomplete with a handler.

The result script is as follow.

<script type="text/javascript">
$(document).ready(function() {
    $("#ctl00_ContentPlaceHolder1_tbDepature").autocomplete('StopsService.ashx', { width: 310 });
    $("#ctl00_ContentPlaceHolder1_tbDestination").autocomplete('StopsService.ashx', { width: 310 });

In StopsService.ashx i populate the content passed in with values with all english and values with all Greek characters.

The autocomplete works fine and as expected with the english characters but it doesnt display at all any options with Greek characters.

Any ideas? Is the problem on the jquery side or the handler side?

Do i need any encodings in the ashx service?

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend