1

My CompletionInterval is 100 and MinimumPrefixLength is 1. Sometimes after typing one letter that I know has completions, like 'a', after roughly one second, maybe less (but 1 second is a specified time), that initial 'a' disappears. When I type another one, I get a list of completions? Does anyone know what is going on here? I'm using v7.0607 of the AjaxControlToolkit that brings v1.4.6 of the HtmlAgilityPack with it.

My AutoCompleteExtender and associates look like this:

<asp:HiddenField runat="server" ClientIDMode="Static" ID="autoCompleteHidden" OnValueChanged="autoCompleteHidden_ValueChanged" />
<asp:TextBox ID="txtSearchField" runat="server" Width="200px"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtSearchField"
    ServicePath="~/AutoComplete.asmx" ServiceMethod="GetVisitors" Enabled="False" CompletionInterval="100"
    MinimumPrefixLength="1" CompletionSetCount="30" OnClientItemSelected="OnAutoCompleteSelected"
    CompletionListCssClass="CompletionList" CompletionListItemCssClass="CompletionListItem" 
    CompletionListHighlightedItemCssClass="CompletionListHighlightedItem">
</ajaxToolkit:AutoCompleteExtender>

NOTE: Enabled is set to True before this control group is used and back to False afterwards. That is NOT the problem.

The accompanying function script, below, works fine.

<script type="text/javascript">
    function OnAutoCompleteSelected(source, eventArgs) {
        $("#autoCompleteHidden").val(eventArgs._text);
        __doPostBack("autoCompleteHidden", "");
    }
</script>

That script triggers the following code-behind handler that fetches the details for the selected visitor. It also works fine:

protected void autoCompleteHidden_ValueChanged(object sender, EventArgs e)
{
    var myVisitorObj = new XTime.OL.VisitorObj();
    myVisitorObj = XTime.BL.myVisitor.SelectVisitorByFullName(autoCompleteHidden.Value);
    if (myVisitorObj.MST_SQ != 0)
    {
        XTime.XTimeVariables.VisitorObj = myVisitorObj;
    }
    ddlSearchBy.SelectedIndex = 0;
    AutoCompleteExtender1.Enabled = false;

    //Need to reload page for Sessions variable to change
    Response.Redirect(Request.Url.ToString());
}
ProfK
  • 49,207
  • 121
  • 399
  • 775
  • It would be helpful to show the markup of your AutoCompleteExtender, and the web service method that returns results. – Josh Darnell Jul 15 '13 at 13:51
  • @jadarnel27 Code added as requested. – ProfK Jul 16 '13 at 07:14
  • I wonder - do you have some CSS that's maybe covering up your TextBox when you have no resuts yet (CSS that's being applied to CompletionList or CompletionListItem). Also, I don't think it will fetch results untl you have *more* characters than the minimum prefix length. But I could be wrong. – Josh Darnell Jul 16 '13 at 15:42
  • @jadarnel27 Thanks! I have never set the `MinimumPrefixLength` below 1, but even if it's 2 or 3 and you type 2 or 3 letters, they often disappear. It doesn't look like the CSS does anything, but I'll check, thanks. – ProfK Jul 17 '13 at 13:32
  • It's most like that some javascript did not load. Can you open a browser debugger and watch, what's happen? I think it may be some javascript not loaded when you try to type 'a' in some cases. – Dima Kurilo Aug 21 '13 at 20:51

0 Answers0