如何在asp.net自动完成文本框中使用分号分隔文本框中的多个值

发布于 2024-12-10 01:31:07 字数 410 浏览 1 评论 0原文

我有一个带有自动完成扩展器的文本框,它工作正常。如何通过用分号 (;) 分隔第一个值来允许用户输入多个值

<asp:TextBox ID="txt_to" runat="server" />

 <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txt_to"
 MinimumPrefixLength="2" CompletionInterval="10" EnableCaching="true" FirstRowSelected="true" CompletionSetCount="3" UseContextKey="True" ServiceMethod="GetCompletionList" />

I have a text box with auto complete extender and it works fine. How can I allow the user to enter more than 1 value by separting the first value with a semicolon(;)

<asp:TextBox ID="txt_to" runat="server" />

 <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txt_to"
 MinimumPrefixLength="2" CompletionInterval="10" EnableCaching="true" FirstRowSelected="true" CompletionSetCount="3" UseContextKey="True" ServiceMethod="GetCompletionList" />

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戏剧牡丹亭 2024-12-17 01:31:07

正如演示页面此处中所述,您应该使用 DelimiterCharacters 属性:

<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
    TargetControlID="txt_to" MinimumPrefixLength="2" CompletionInterval="10"
    EnableCaching="true" FirstRowSelected="true" CompletionSetCount="3"
    UseContextKey="True" ServiceMethod="GetCompletionList"
    DelimiterCharacters=";" />

As explained in the demo page here, you should use the DelimiterCharacters property:

<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
    TargetControlID="txt_to" MinimumPrefixLength="2" CompletionInterval="10"
    EnableCaching="true" FirstRowSelected="true" CompletionSetCount="3"
    UseContextKey="True" ServiceMethod="GetCompletionList"
    DelimiterCharacters=";" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文