There are many existing implementations available for this kind of behaviour. You may want to reconsider reinventing the wheel, here.
If you must, you could handle key press events in the textbox and invoke the webservice using an AJAX hit. You could then parse the response text and build an HTML list within a DIV that shows up dynamically. On May 22, 9:18 pm, isaac2004 <[email protected]> wrote: > so i fixed it so the webservice returns an array, how do i set up the > aspx page to grab the array and make the textbox "suggest" the items > > On May 22, 8:34 am, "P. Bixam" <[email protected]> wrote: > > > > >http://www.asp.net/ajax/documentation/live/ > > > On Fri, May 22, 2009 at 12:52 AM, isaac2004 <[email protected]> wrote: > > > > i am trying to display an autosuggest textbox that grabs information > > > from a database, there are there alot of examples out there but i > > > would like to use a webservice that i have created. how would i go > > > about doing it with this webservice > > > > <%@ WebService Language="C#" Class="WebService" %> > > > > using System; > > > using System.Web; > > > using System.Web.Services; > > > using System.Web.Services.Protocols; > > > using System.Data; > > > > [WebService(Namespace = "http://tempuri.org/")] > > > [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] > > > public class WebService : System.Web.Services.WebService > > > { > > > [WebMethod(Description = "Input a name and it will return > > > players")] > > > > public DataSet SearchPlayer(string query) > > > { > > > //Initialize data access class used in MIS 324 (written in > > > VB.NET) > > > string strSQL = "Select nameFirst, nameLast from FullMaster > > > where (nameFirst LIKE '" + query + "%') or (nameLast like '" + query + > > > "%')"; > > > DataAccess objDataAccess = new DataAccess("BaseballDatabase"); > > > DataTable dt = new DataTable(); > > > dt = objDataAccess.FillDataTable(strSQL); > > > > //Note: web services can return DataSets but not DataTables. > > > DataSet ds = new DataSet("dsPlayer"); > > > ds.Tables.Add(dt); > > > ds.AcceptChanges(); > > > return ds; > > > > } > > > > } > > > > in my asmx page, i want to create an ajax textbox that displays info > > > from that webservice, any help would be great- Hide quoted text - > > - Show quoted text -
