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());
}