How to display selected values from list box in label
I have a list b开发者_开发技巧ox with multiple selection option , i wanted to display user the selections he has made .
How to display that users in stylish way .
Can anyone help me on this .
Thanks Smartdev
Well, on postback, the listbox's Items collection can be iterated over and the Selected property checked.
Something like this:
lblResult.Text = "";
foreach (ListItem li in lbxItems.Items)
{
if (li.Selected)
{
lblResult.Text += li.Text + "<br/>";
}
}
As for making it "stylish".. well that's a bit subjective!
精彩评论