【问题标题】:How to make optgroups using ASP.NET WebForms如何使用 ASP.NET WebForms 制作 optgroups
【发布时间】:2011-08-13 18:05:26
【问题描述】:

我正在使用 ASP.NET。我想使用数据绑定到来自 SQL Server 的数据在 DropDownList 中创建 optgroups。例如,我有两张桌子——一张代表国家,另一张代表州。在 ASP.NET 的下拉列表中,我想绑定到这两个表中的数据。 country 表应该成为 optgroup,并且 states 应该在它之下。

-印度- 喀拉拉邦 泰米尔纳德邦 -美国- 纽约

【问题讨论】:

    标签: asp.net sql-server-2008


    【解决方案1】:

    实际上,您可以通过 hack 解决此问题。像这样覆盖 DropDownlist 的 RenderContents http://weblogs.asp.net/jeff/archive/2006/12/27/dropdownlist-with-optgroup.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多