使用C#自动填充Asp.net的下拉列表 [英] Auto fill dropdown of Asp.net using C#

查看:120
本文介绍了使用C#自动填充Asp.net的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个矿山应用程序中,我想进行下拉,这样,当按下"i"时,首字母为"i"的数据将显示在下拉菜单中,然后再次显示"n",则必须显示下拉菜单以这种方式以"in"开头的数据...
我正在使用< asp:dropdown>

In one of mine application i would like to make dropdown such way that when press ''i'' then data with start letter ''i'' will display in dropdown and again ''n'' then dropdown have to show the data which start with ''in'' such way...
i am using <asp:dropdown>

推荐答案


看看这些帖子:
http://forums.asp.net/t/1532181.aspx/1 [ ^ ]

http://www.devcurry.com/2009/06/cause- postback-on-keypress-from-aspnet.html [ ^ ]

干杯
Hi,
Take a look at these posts:
http://forums.asp.net/t/1532181.aspx/1[^]

http://www.devcurry.com/2009/06/cause-postback-on-keypress-from-aspnet.html[^]

Cheers


Create AutoSuggestBox.css file and place the below css Code
==========================================================

.CompletionList
{
    background-repeat: repeat-x;
    background-color: #FFFFFF;
    z-index: 10000;
    width: 245px !important;
    max-height: 210px;
    text-align: inherit;
    text-indent: -1;
    list-style: none;
    overflow-y: scroll;
    scrollbar-arrow-color: #B89020;
    scrollbar-base-color: #8E6E1C;
    scrollbar-face-color: #B6C5D4;
    scrollbar-3dlight-color: #8E6E1C;
    scrollbar-highlight-color: #EED47D;
    scrollbar-shadow-color: #959595;
    scrollbar-darkshadow-color: #00337E;
    margin-left: 0px;
    border-bottom: 1px solid #B5C6D4;
    border-left: 1px solid #B5C6D4;
    border-top: 1px solid #B5C6D4;
    margin-top: 0px;
}
.CompletionListItemCssClass
{
    background: none;
    border-collapse: collapse;
    color: #00337E;
    white-space: nowrap;
    text-align: inherit left;
}
.CompletionListHighlightedItemCssClass
{
    background-repeat: repeat-x;
    background-color: #EED47D;
    color: #00337E;
    border-top: 1px solid #FFF8E8;
    border-left: 1px solid #FFF8E8;
    border-bottom: 1px solid #00337E;
    border-right: 1px solid #00337E;
}

==========================================================
Place this in .aspx file

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<link href="../App_Themes/AutoSuggestBox.css" rel="Stylesheet" type="text/css" />

    <script type="text/javascript">
    function Common_ItemSelected(sender, e)
    {
        var hdnCommonID =


get('<% = hdnCommonID​​.ClientID %> ; '); hdnCommonID​​.value = e.get_value(); } 函数Common_ItemPopulated(sender,e) { var hdnCommonID​​ =
get('<%= hdnCommonID.ClientID %>'); hdnCommonID.value = e.get_value(); } function Common_ItemPopulated(sender, e) { var hdnCommonID =


这篇关于使用C#自动填充Asp.net的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆