locked
autocomplete in gridview not working RRS feed

  • Question

  • User-1474096950 posted

    using <ajaxToolkit:AutoCompleteExtender to fill a textbox with data from table

    i have written the AutoComplete.asmx, though i dont get any errors , the textbox is not getting autocomplete

    i have put a breakpoint in asmx page but the file is not called

    my html is

    <ItemTemplate>
                                                <asp:TextBox ID="txtName" runat="server" AutoPostBack="true" Width="200px" Height="15px" Text="0" 
                                                   Enabled="true" Style="text-align: right" />
                                                   <ajaxToolkit:AutoCompleteExtender
                                     runat="server"
                                     ID="autoComplete1"
                                     TargetControlID="txtName"
                                     ServicePath="AutoComplete.asmx"
                                     ServiceMethod="GetCompletionList"
                                     MinimumPrefixLength="1"
                                     CompletionInterval="10"
                                     EnableCaching="true"
                                     CompletionSetCount="12" />
                                                  </ItemTemplate>

    Saturday, September 27, 2014 5:45 AM

Answers

  • User1918509225 posted

    Hi svibuk,

    For your issue,please check if you have added the script attribute in your web service method:

    [System.Web.Script.Services.ScriptMethod()]
    
    [System.Web.Services.WebMethod]

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 28, 2014 10:14 PM

All replies

  • User-760709272 posted

    Is the path to "AutoComplete.asmx" correct?  That will only work if the asmx file is at the same level as your aspx page.  Try giving it an absolute reference insteadm like

    ServicePath="/AutoComplete.asmx"

    You can use the browser tools to see if the code is trying to call your service, what url it is accessing and the result of that call.

    http://forums.asp.net/t/1982579.aspx?Using+the+browser+s+dev+tools+to+diagnose+ajax+problems+and+other+things+

    Saturday, September 27, 2014 9:49 AM
  • User1918509225 posted

    Hi svibuk,

    For your issue,please check if you have added the script attribute in your web service method:

    [System.Web.Script.Services.ScriptMethod()]
    
    [System.Web.Services.WebMethod]

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 28, 2014 10:14 PM