zoukankan      html  css  js  c++  java
  • AJAX Control Toolkit ListSearch

    1.ListSearch Server Reference

    PromptText - Message to display when the ListBox or DropDownList is given focus. Default is 'Type to search'. The PromptText is replaced by the search text typed by the user.

    PromptCssClass - The name of the CSS class to apply to the prompt message.

    PromptPosition - Indicates whether the message should appear at the Top or Bottom of the ListBox. The default is Top.

    QueryPattern - Indicates how the typed characters should be used in the search query. The default pattern queries for results that start with the typed word.

    IsSorted - Indicates if items added to the List are expected to be sorted. The default is false. If set to true it allows the code to perform a faster search instead of having to determine the same before performing the search.

    QueryTimeout - Indicates whether the search query should be reset after the timeout if no match is found. The default is 0, meaning no auto reset behavior.

    Animations- Generic animations for the ListSearch extender. See the Using Animations walkthrough and Animation Reference for more details.

    •  OnShow- The OnShow animation will be played each time the extender's prompt is displayed. The prompt will be positioned correctly but hidden. The animation can use  to display the prompt along with any other visual effects.
    • OnHide - The OnHide animation will be played each time the
     1  <asp:ScriptManager ID="ScriptManager1" runat="server" />
    2 <br />
    3 <div style="text-align: center">
    4 Click on this ListBox and start typing to search for an entry:
    5 <br />
    6 <br />
    7 List Box:<br />
    8 <br />
    9 <asp:ListBox ID="ListBox1" runat="server" Width="100px" />
    10 <ajaxToolkit:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ListBox1"
    11 PromptCssClass="ListSearchExtenderPrompt">
    12 </ajaxToolkit:ListSearchExtender>
    13 <br />
    14 <br />
    15 DropDownList:<br />
    16 <br />
    17 <asp:DropDownList ID="DropDownList1" runat="server" Width="100px" />
    18 <ajaxToolkit:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="DropDownList1"
    19 PromptCssClass="ListSearchExtenderPrompt">
    20 </ajaxToolkit:ListSearchExtender>
    21 </div>

      

    C# Code
     1  protected override void OnLoad(EventArgs e)
    2 {
    3 base.OnLoad(e);
    4 ListBox1.DataSource = GetWordListText();
    5 ListBox1.DataBind();
    6 DropDownList1.DataSource = GetWordListText();
    7 DropDownList1.DataBind();
    8 }
    9
    10
    11 private static string[] wordListText;
    12 public string[] GetWordListText()
    13 {
    14 // This is the NATO phonetic alphabet (http://en.wikipedia.org/wiki/NATO_phonetic_alphabet)
    15 // and was chosen for its size, non-specificity, and presence of multiple words with the same
    16 // starting letter.
    17 if (null == wordListText)
    18 {
    19 string[] tempWordListText = new string[] {
    20 "Alfa",
    21 "Alpha",
    22 "Bravo",
    23 "Charlie",
    24 "Delta",
    25 "Echo",
    26 "Foxtrot",
    27 "Golf",
    28 "Hotel",
    29 "India",
    30 "Juliett",
    31 "Juliet",
    32 "Kilo",
    33 "Lima",
    34 "Mike",
    35 "November",
    36 "Oscar",
    37 "Papa",
    38 "Quebec",
    39 "Romeo",
    40 "Sierra",
    41 "Tango",
    42 "Uniform",
    43 "Victor",
    44 "Whiskey",
    45 "X-ray",
    46 "Xray",
    47 "Yankee",
    48 "Zulu",
    49 "Zero",
    50 "Nadazero",
    51 "One",
    52 "Unaone",
    53 "Two",
    54 "Bissotwo",
    55 "Three",
    56 "Terrathree",
    57 "Four",
    58 "Kartefour",
    59 "Five",
    60 "Pantafive",
    61 "Six",
    62 "Soxisix",
    63 "Seven",
    64 "Setteseven",
    65 "Eight",
    66 "Oktoeight",
    67 "Nine",
    68 "Novenine"
    69 };
    70 Array.Sort(tempWordListText);
    71 wordListText = tempWordListText;
    72 }
    73 return wordListText;
    74 }

      

  • 相关阅读:
    多种方法求解八数码问题
    GridView编辑删除操作
    【翻译自mos文章】v$undostat视图没有依照每10分钟进行更新,v$undostat仅仅有1行(one rows)
    支持向量机通俗导论(理解SVM的三层境地)
    bootstrap课程13 bootstrap的官方文档中有一些控件的使用有bug,如何解决这个问题
    bootstrap课程12 滚动监听如何实现(bootstrap方式和自定义方式)
    bootstrap课程11 模态框如何使用
    bootstrap课程10 从外部引入视频到页面用什么标签
    bootstrap课程9 bootstrap如何实现动画加载进度条的效果
    bootstrap课程8 bootstrap导航条在不同设备上的显示效果如何
  • 原文地址:https://www.cnblogs.com/January/p/2134574.html
Copyright © 2011-2022 走看看