any help plz....
On May 23, 11:45 am, isaac2004 <[email protected]> wrote: > ok, i set up the AJAX Auto Control, but when i run it, firebug gives > me a 500 error, saying Invalid web service call, missing value for > parameter: > > Here is my asmx which works completely fine > > <%@ WebService Language="C#" Class="WebService" %> > > using System; > using System.Web; > using System.Web.Services; > using System.Web.Services.Protocols; > using System.Data; > using System.Collections.Generic; > [WebService(Namespace = "http://tempuri.org/")] > [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] > [System.Web.Script.Services.ScriptService] > public class WebService : System.Web.Services.WebService > { > [WebMethod(Description = "Input a Player and this returns a > list")] > > public string[] GetPlayer(string query) > { > > //Initialize data access class > 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); > List<string> items = new List<string>(dt.Rows.Count); > foreach (DataRow dr in dt.Rows) > { > string c1 = Convert.ToString(dr["nameFirst"]) + " " + > Convert.ToString(dr["nameLast"]); > items.Add(c1); > } > return items.ToArray(); > } > > } > > and my apspx page > > <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" > %> > > <%@ Register Assembly="AjaxControlToolkit" > Namespace="AjaxControlToolkit" TagPrefix="cc1" %> > > <script runat="server"> > > </script> > > <asp:Content ID="Content1" ContentPlaceHolderID="MainForm" > Runat="Server"> > <asp:ScriptManager ID="ScriptManager1" runat="server"> > <Services> > <asp:ServiceReference Path="Player.asmx" /> > </Services> > </asp:ScriptManager> > <asp:TextBox ID="TextBox1" runat="server" Height="45px" > Width="312px"></asp:TextBox> > <cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" > runat="server" > TargetControlID="TextBox1" ServicePath="Player.asmx" > ServiceMethod="GetPlayer" MinimumPrefixLength="3" > > </cc1:AutoCompleteExtender> > <br /><br /><br /> > </asp:Content> > > im not sure what i am doing wrong, thanks for all the help > > On May 23, 10:18 am, "P. Bixam" <[email protected]> wrote: > > > if u have VS2005+AJAX installed > > add the ref of AjaxControlToolkit > > Drag n Drop 'AutoCompleteExtender' Control and set its properties. > > > finally associate this to ur TextBox. > > > Bixam. > > > On Fri, May 22, 2009 at 9:18 AM, 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
