后台生成textbox并设置多行属性,自动换行

Table tb = new Table();
TableRow row1 = new TableRow();
TableCell tc1 = new TableCell();
TableCell tc2 = new TableCell();

Image img = new Image();
img.ImageUrl = item.Picurl;

TextBox text = new TextBox();
text.Text = item.Notes;
text.CssClass = "text";
text.Wrap = true;
text.TextMode = TextBoxMode.MultiLine;

tc1.Controls.Add(img);
tc2.Controls.Add(text);

row1.Controls.Add(tc1);
row1.Controls.Add(tc2);

tb.Controls.Add(row1);

photos.Controls.Add(tb);

posted on 2015-01-18 15:51  ctautoRR  阅读(253)  评论(0编辑  收藏  举报

导航