沒有人知道如何創建選項卡動態基於從列表框中選擇的內容?創建選項卡動態基於ASP.Net中列表框中選擇的值
這是我有:
列表框:
<asp:ListBox ID="SelectionListBox" runat="server" AppendDataBoundItems="True" SelectionMode="Multiple" Height="130px" Width="350px">
<asp:ListItem Text="Apple" Value ="1" />
<asp:ListItem Text="Watermelon" Value ="2" />
<asp:ListItem Text="Kiwi" Value ="3" />
<asp:ListItem Text="Plum" Value ="4" />
<asp:ListItem Text="Pineapple" Value ="5" />
</asp:ListBox>
RetrieveButton:
<asp:Button ID="RetrieveButton" runat="server" Text="Button" />
基於什麼樣的用戶已經從列表框中選擇,用戶時按下「檢索」按鈕時,將根據va的數量創建標籤數量lues用戶已從列表框中選擇。
例如:
比方說,用戶已經從列表框中選擇3項並點擊按鈕,3個標籤應在頁面底部用的相同頁面上創建標籤名稱作爲列表框項目文本。
輸出:
+ ---------------------------------- +
ListBox
RetrieveButton
+ ---------------------------------- +
Tabs:
Apple | Watermelon | Kiwi
+ - --------------------------------- +
任何幫助都很大ppreciated。謝謝!
Taleeb您好,感謝的解決方案!我是jquery的新手,所以當我試圖將這段代碼添加到我的項目中時,發生錯誤。你知道除jQuery之外的其他解決方案嗎? –
你是否在使用任何標籤插件(基本上你打算如何呈現標籤)。也讓我們知道你得到的錯誤,我們可以嘗試解決這個問題。 – Taleeb
@ FeliciaSoh。我已經使用純JavaScript添加了一個代碼(沒有jQuery/jQueryUI)。除其他問題之外 - 代碼的一個問題是它沒有響應。如果你可以使用jQuery或bootstrap標籤,那將會好得多.. – Taleeb