1
我想在下拉列表框或列表框中顯示類別和子類別中的內容。需要功能像下拉列表框或列表框中的optgroup
的在這個例子中內容
Mobile
Nokia
IPhone
LG
Laptop
Dell
HP
HCL
實施例移動和筆記本是類和其餘爲子類。 我希望該用戶無法選擇類別,但會顯示。 用戶只能選擇子類別。
請幫我找到解決方案。
我想在下拉列表框或列表框中顯示類別和子類別中的內容。需要功能像下拉列表框或列表框中的optgroup
的在這個例子中內容
Mobile
Nokia
IPhone
LG
Laptop
Dell
HP
HCL
實施例移動和筆記本是類和其餘爲子類。 我希望該用戶無法選擇類別,但會顯示。 用戶只能選擇子類別。
請幫我找到解決方案。
問題是有點不清楚,但如果你正在尋找的標記,儘量
<select>
<optgroup label="Mobile">
<option>Nokia</option>
<option>IPhone</option>
<option>LG</option>
</optgroup>
<optgroup label="Laptop">
<option>Dell</option>
<option>HP</option>
<option>HCL</option>
</optgroup>
</select>
在asp.net來實現這一目標,this post介紹如何修改MVC的DropDownList
實現。
謝謝ans,但我需要在asp.net解決方案。 –
已添加指向[此帖子]的鏈接(http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items - 分類的.aspx),打破如何在asp.net做到這一點 – PassKit