【问题标题】:How to prevent enter data into an ajax combobox control?如何防止将数据输入 ajax 组合框控件?
【发布时间】:2013-10-19 04:00:36
【问题描述】:
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

  <asp:ComboBox ID="service_list" runat="server" AutoPostBack="true" DataTextField="CL_DESCRIPTION" 
                    DataValueField="CL_ID" ondatabound="MyListDataBound"
                    DataSourceID="SqlDataSource1" CssClass="RedTypeComboBoxStyle" >
                        </asp:ComboBox >

如何禁止用户在 ajax 组合框的文本框中输入数据?

注意:我不想使用下拉列表,因为我正在使用 css 来更改 ajax 组合框的设计,但我只需要阻止用户在组合框中输入数据..

我该怎么做?

【问题讨论】:

    标签: asp.net vb.net combobox asp.net-ajax ajaxcontroltoolkit


    【解决方案1】:

    DropDownStyle - 确定是否允许用户输入与列表中的项目不匹配的文本,以及是否始终显示列表。

    如果指定“DropDownList”,则不允许用户输入与列表中的项目不匹配的文本。
    当指定“DropDown”(默认值)时,允许输入任何文本。
    如果指定了“简单”,则允许使用任何文本,并且无论 AutoCompleteMode 属性值如何,都会始终显示列表。

    参考资料:-
    http://www.asp.net/ajaxlibrary/act_ComboBox.ashx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 2011-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多