开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜