【问题标题】:Creating Drop down with Check Box in asp.net在 asp.net 中使用复选框创建下拉菜单
【发布时间】:2014-05-09 20:41:36
【问题描述】:

我正在尝试使用文本框和弹出控件扩展器创建一个带有复选框的下拉菜单,但每当我运行它时都会出现此错误:

错误:'Sys.Extended.UI' 为空或不是对象'。

我正在尝试尽可能简单,但不确定我在这里缺少什么。代码如下:

<asp:TextBox ID="ddl_TextLog" runat="server" AutoPostBack="true" BackColor="#FFFFCC" Style="background-color: #FFCC66" Width="250px"></asp:TextBox>        
<asp:PopupControlExtender ID="TextBox1_PopupControlExtenderLog" runat="server"  Enabled="True" ExtenderControlID="" TargetControlID="ddl_TextLog" PopupControlID="pnl_Log" OffsetY="22"></asp:PopupControlExtender>

<asp:Panel ID="pnl_Log" runat="server" Height="180px" Width="250px" BorderStyle="Solid" BorderWidth="2px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#FFFFCC" Style="display: none">
    <asp:CheckBoxList ID="CheckBoxList_Log" runat="server" DataSourceID="SqlDataSource_Log" DataTextField="MDE" DataValueField="MDE" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList_Log_SelectedIndexChanged"></asp:CheckBoxList>
    <asp:SqlDataSource ID="SqlDataSource_Log" runat="server" ConnectionString="<%$ ConnectionStrings:DCR-DWH-MS-01-DA2 %>" SelectCommand=" SELECT DISTINCT MDE FROM myTable ORDER BY MDE ASC"></asp:SqlDataSource>
</asp:Panel>

【问题讨论】:

标签: c# asp.net


【解决方案1】:

我不得不使用它并解决了我的问题:

<ajaxToolkit:ToolkitScriptManager runat="server" ID="ToolkitScriptManager1" />

【讨论】:

  • 我现在唯一的问题是当我从复选框列表中进行选择时,面板保持打开状态。如果我选择另一个文本框,我希望面板能走一条路,那我该怎么做?请帮忙。谢谢
  • 既然您解决了原始问题,请将此答案标记为正确,然后再打开另一个问题。谢谢
猜你喜欢
  • 2021-04-09
  • 1970-01-01
  • 1970-01-01
  • 2014-09-26
  • 1970-01-01
  • 1970-01-01
  • 2023-03-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多