<% Html.Obout(new ListBox("ListBox1") { Width = Unit.Pixel(300), }); %> <% Html.Obout(new OboutCheckBox("OboutCheckBox1") { Text = "Get Selected Item", OnClientClick = "return getSelectedItem();" }); %>
@Html.Obout(new ListBox("ListBox1") { Width = Unit.Pixel(300), }) @Html.Obout(new OboutCheckBox("OboutCheckBox1") { Text = "Get Selected Item", OnClientClick = "return getSelectedItem();" })
function getSelectedItem() { if (ListBox1.selectedIndex() != -1) { alert('Selected item: ' + ListBox1.options[ListBox1.selectedIndex()].text); } else { alert('No selected item.'); } return false; }