Hi Kevin, I had a huge fight with the same problem yesterday. But finally it is working now. So, what type of error did you have? Here is what I did to get it work: First I tried it with single page before I implement it in my project. So no namespaces and other complications... I test it on the latest AJAX.NET version 6.7.20.1 and .NET 2.0
I haven't found a bug in your script, but it is needed to look over a few things: First: Web.Config -> in Configuration section: <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <configSections> <sectionGroup name="ajaxNet"> <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2" requirePermission="false" restartOnExternalChanges="true"/> </sectionGroup> </configSections> <ajaxNet> <ajaxSettings> <urlNamespaceMappings useAssemblyQualifiedName="false"> <add type="MyAjaxMethods,App_Code" path="_a" /> </urlNamespaceMappings> <jsonConverters> <add type="AjaxPro.BitmapConverter,AjaxPro.2"/> </jsonConverters> <oldStyle> <includeMsPrototype/> </oldStyle> </ajaxSettings> </ajaxNet> ..... and in system.web <system.web> <httpHandlers> <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/> </httpHandlers> ... I saw you had similar code so it should be ok. in my click.aspx.cs I have following: using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class click : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(click)); } [AjaxPro.AjaxMethod] public DataTable Search(string search, int count) { // here I'm using a bussiness layer for calling a stored procedure, so skip it. /*DataTable dt = new DataTable(); UsersM users = new UsersM(); dt = users.GetUsers(search); return dt;*/ DataTable dt = new DataTable(); dt.Columns.Add("CustomerID", typeof(int)); dt.Columns.Add("CustomerName", typeof(string)); DataRow radek = dt.NewRow(); radek[0] = 12; radek[1] = "alfa"; dt.Rows.Add(radek); return dt; } } Like I said, I have no namespace, only class click and method Search. In this example is only one row in datatable, but it's easy to implement your own code later. In the file AutoComlete.js I didn't make any changes!!! So leave it. and in click.aspx: ... <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox> </div> <script type="text/javascript" src="Scripts/autocomplete.js"></script> <script type="text/javascript"> function init() { var x = new MS.Web.AutoCompleteDataTable("txtSearch", 10); x.getDisplay = function(item) { return (item != null ? item.CustomerName: ""); } x.getValue = function(item) { // return item.CustomerID; return (item != null ? item.CustomerName.toString().trimRight() : ""); } x.getData = function() { click.Search(this.ele.value, this.count, this.callback.bind(this)); }; } setTimeout(init, 1); </script> ... The only change from the example is that I call a click.Search method instead of AutoComplete.Search. Very important is also where you put your script in the code, because it must be at the end of your html code or you'll get error - MS.... is null or something like that. I hope this will help and if not, please send me your error. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ajax.NET Professional" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ajaxpro The latest downloads of Ajax.NET Professional can be found at http://www.ajaxpro.info/ Don't forget to read my blog at http://weblogs.asp.net/mschwarz/ -~----------~----~----~----~------~----~------~--~---
