我正在使用自动完成扩展器。
问题是当用户开始输入第二个词并选择自动完成建议时,它会用建议替换第二个词,但保留第一个词。
我输入“Cherry Cobbler”
自动完成显示“Desert, Cherry Cobbler, 1 Slice”
当我点击自动完成建议时,它在我的文本框中最终确定为“Cherry Desert, Cherry Cobbler, 1 Slice”。第一个词樱桃不应该在那里。
有什么想法吗?
<asp:TextBox ID="txtLunch" CssClass="headerinput" runat="server" AutoPostBack="True" OnTextChanged="txtLunch_TextChanged"></asp:TextBox> <strong id="quantitylunch" runat="server" style="font-family: Arial; font-size: 12px; padding-right: 5px; padding-left: 5px;">Quantity</strong>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" UseContextKey="true" ContextKey="" Enabled="True" ServicePath="/service/service1.asmx" ServiceMethod="GetFoodNames" MinimumPrefixLength="1" CompletionSetCount="10" TargetControlID="txtLunch" CompletionInterval="500" CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true">
</ajaxToolkit:AutoCompleteExtender>
最佳答案
我找到了答案,删除分隔符中的空格。
DelimiterCharacters=";,:"
关于c# - 多个单词导致自动完成扩展程序出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17182515/