开发者

ASP.net - one label, multiple values

I have a label, lblmessage, which I want to assign 4 different values.

It should show up like thi开发者_运维知识库s:
5
4
3
2

I know this: lblmessage.text = "5" and to assign it another value lblmessage.text = lblmessage.text + "4".

This just puts them next to each other, but how can I get them to show up underneath each other?

Thanks!


Use:

lblmessage.Text += "<br />4";

Although I suggest that you use a StringBuilder.


You can do like..

lblmessage.Text = string.Format("{0}<br/>{1}<br/>{2}<br/>{3}<br/>", "5", "4", "3", "2");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜