c# - 多个单词导致自动完成扩展程序出现问题

标签 c# asp.net .net autocompleteextender

我正在使用自动完成扩展器。

问题是当用户开始输入第二个词并选择自动完成建议时,它会用建议替换第二个词,但保留第一个词。

我输入“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/

相关文章:

c# - 如何使用 ASP.NET WebForms 和现有的 SQL Server 数据库实现登录功能?

asp.net - 通过 ASP.NET 发布到 Facebook 页面

asp.net - 在发布时更改 .config 文件中的附加程序参数值( azure 管道)

c# - MVC 在 View 中显示文件夹中的文件

c# - c# System.Type 类型如何具有名称属性

c# - 使用用户名和密码启动进程

c# - 给 Entity Framework 生成的类添加数据注解

c# - 提交后清除所有字段

c# - 从 JQuery 访问文本框

c# - WPF将ResourceDictionary中的Brush设置为ViewModel中的属性