Net的标记列表控件

Net的标记列表控件

本文介绍了ASP.Net的标记列表控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道ASP.Net的轻量级列表控件,可以在其中将标记的项目添加到水平线上?像这样的东西:

Does any of you know of a lightweight list control for ASP.Net where I could add badged items on a horizontal line? Something like this:

推荐答案

我使用了RadAutoCompleteBox,它具有所需的完整功能.谢谢Telerik.

I used RadAutoCompleteBox which has the complete functions I needed.Thanks Telerik.

http://docs.telerik.com/devtools/aspnet- ajax/controls/autocompletebox/overview

添加了对 Telerik for ASP.Net 和示例代码的引用:

Added reference to Telerik for ASP.Net and sample code:

<telerik:RadAutoCompleteBox runat="server" ID="KeywordsAutoComplete"
Width="100%" OnLoad="KeywordsAutoComplete_Load" OnClientEntryAdding="restrictDuplicateEntry"
EmptyMessage="Type keywords..."
CssClass="autocompletebox control transition-025"
AllowCustomEntry="true" />

<script type="text/javascript">
    // Restrict Duplicate Entry
    function restrictDuplicateEntry(sender, eventArgs) {
                var entries = sender.get_entries(),
                count = entries.get_count();

                for (var i = 0; i < count; i++) {
                    if (entries.getEntry(i).get_text() == eventArgs.get_entry().get_text())
                    {
                        eventArgs.set_cancel(true);
                        return;
                    }
                }
            }
</script>

C#:

protected void KeywordsAutoComplete_Load(object sender, EventArgs e)
{
    DataTable dt; // Binding Data (For Lookup)
    KeywordsAutoComplete.DataSource = dt;
    KeywordsAutoComplete.DataBind();
}

这篇关于ASP.Net的标记列表控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:50