Question

I'm using the sample AutoCompleteExtender on the asp.net ajax site and am running into unwated behavior. First let me just say the sample from the asp.net site is just too dang slow. The 1 second CompletionInterval is too long for my taste. So I lower it to 300 ms and now I get these request aborted messages. Firebug shows me this:

POST http://localhost:49539/AutoComplete.asmx/GetCompletionList Aborted

When the request is aborted, it obviously fails to retrieve the new list and thus not displaying the list of options which makes for a poor user experience. If I type slowly, then the requests go through fine and I get the list of options. It seems like I need every request to complete to give the user the best experience, but note sure...

Does anyone know what I need to do to always make the list pop up within 100-400 ms of typing a letter?

Note: It looks like IE and Chrome are not aborting the requests and thus I get a much better response time and the list pops up right away. This may be a fluke and work differently on another computer - I don't know.

Also note: My GetCompletionList() function is very basic and only returns hard coded values (no DB requests), so it's very fast.

Here's the aspx

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:TextBox ID="TextBox1" runat="server" autocomplete="off"></asp:TextBox>
        <ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" 
            TargetControlID="TextBox1" 
            ServicePath="~/AutoComplete.asmx" 
            ServiceMethod="GetCompletionList"
            MinimumPrefixLength="1" 
            CompletionInterval="200"
            CompletionSetCount="12"
            EnableCaching="true">
        </ajaxToolkit:AutoCompleteExtender>    
    </ContentTemplate>
</asp:UpdatePanel>
Was it helpful?

Solution

Since nobody has answered my question for weeks now, I'll give it a shot.

I'm not 100% sure this was my problem, but I'm inclined to think it was caused by the web server that ships with visual studio. I had a similar problem with another project but it was hosted on the local IIS server (change the project properties under the web tab) and the requests weren't getting aborted.

The reason I'm not 100% sure is the project was using a jquery library that was getting abort requests when using the visual studio built in web server, but not so when using the local IIS server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top