AutoCompleteExtender doesn't appear in the page

Last post 10-23-2006 10:53 AM by jbfurlong. 4 replies.

Sort Posts:

  • AutoCompleteExtender doesn't appear in the page

    10-23-2006, 8:05 AM
    • Member
      15 point Member
    • Mattalone
    • Member since 05-05-2003, 9:23 AM
    • Italy
    • Posts 3

    Hi,
    I have some problem with the new release of AJAX 1.0 beta...
    My test scenario is one .aspx page like this: 

        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <div>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="2"
                    ServiceMethod="GetSuggestions" ServicePath="~/WebServiceTest.asmx" TargetControlID="TextBox1" />
            </div>
        </form>

    the WebService is:

    using System;
    using System.Web;
    using System.Collections;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using Microsoft.Web.Script.Services;
    
    
    /// <summary>
    /// Summary description for WebServiceTest
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class WebServiceTest : System.Web.Services.WebService {
    
        public WebServiceTest () {
    
            //Uncomment the following line if using designed components 
            //InitializeComponent(); 
        }
    
        [ScriptMethod]
        public string[] GetSuggestions(string prefixText, int count)
        {
            string[] r = new string[count];
            for (int i = 0; i < r.Length; i++)
                r[i] = string.Format("{0} ({1})", prefixText, i);
            return r;
    
        }    
    }
      

    the Microsoft.Web.Preview.dll is in the BIN folder,
    the web.config is correctly configured (I read the .doc guide "from ATLAS to AJAX 1.0 beta"),

    but... the AutoCompleteExtender doesn't apper in the page when I digit something in the TextBox. No JS errors, no compilation errors.. where am I making mistake? Embarrassed

    Thanks for every suggestion in advantage Smile

    Ps. with the july CTP I didn't have problems.. it was all ok...

  • Re: AutoCompleteExtender doesn't appear in the page

    10-23-2006, 9:34 AM
    • Member
      10 point Member
    • Shawn Shi
    • Member since 09-13-2006, 6:22 PM
    • Posts 2

    Have you installed the new ASP.NET AJAX Control Toolkit? Please update Bin\AjaxControlToolkit.dll with the new release.

    I have a web site with the old Atlas Control Toolkit 914, after upgrading to Beta 1, most controls need re-config to work.

    Shawn

  • Re: AutoCompleteExtender doesn't appear in the page

    10-23-2006, 9:51 AM
    • Member
      15 point Member
    • Mattalone
    • Member since 05-05-2003, 9:23 AM
    • Italy
    • Posts 3

    Sorry but.. I need AjaxControlToolkit.dll in my Bin folder?
    I'm using AutoCompleteExtender class of Microsoft.Web.Preview.UI.Controls namespace.. Confused

    By the way, I tried with it into Bin folder but nothing, the ACE doesn't appears in the page.

    Thanks

  • Re: AutoCompleteExtender doesn't appear in the page

    10-23-2006, 10:26 AM
    • Member
      15 point Member
    • Mattalone
    • Member since 05-05-2003, 9:23 AM
    • Italy
    • Posts 3

    Ok I found the problem: the WebService (now) needs the [ScriptService] attribute during class declaration:

     

    using System;
    using System.Web;
    using System.Collections;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using Microsoft.Web.Script.Services;
    
    
    [ScriptService]
    public class WebServiceTest : System.Web.Services.WebService {
    
        public WebServiceTest () {
    
            //Uncomment the following line if using designed components 
            //InitializeComponent(); 
        }
    
        [WebMethod]
        public string[] GetSuggestions(string prefixText, int count)
        {
            string[] r = new string[count];
            for (int i = 0; i < r.Length; i++)
                r[i] = string.Format("{0} ({1})", prefixText, i);
            return r;
    
        }    
    }
    Wink 
  • Re: AutoCompleteExtender doesn't appear in the page

    10-23-2006, 10:53 AM
    • Member
      145 point Member
    • jbfurlong
    • Member since 06-30-2002, 11:59 PM
    • Posts 29

    You will also need the [ScriptMethod] on the Method

    [WebMethod][ScriptMethod]
    public String[] GetCountriesWordList(string prefixText)
    { etc....

    j b furlong | crosswins
Page 1 of 1 (5 items)