我正在创建一个表格单元格,在中,我想要一个图像,在图像下面是一个描述。因此,我尝试这样做:
TableCell cell = new TableCell();
ImageButton i = new ImageButton
{
ImageUrl = image.fullThumbPath,
PostBackUrl =
"~/fulldisplay.aspx?imageId=" + image.visibleId + @"&r=" +
GlobalVariables.RandomString(5)
};
cell.Controls.Add(i);
Label l = new Label
{
Text = image.description
};
l.Style.Add("font-weight", "bold");
cell.Controls.Add(l);
row.Cells.Add(cell);然而,我最终得到的是图像,图像旁边是一个标签。如何确保标签在图像下?我不能添加
。
发布于 2012-01-01 15:28:02
看看像下面这样修改你的代码是否适合你。
Label l = new Label
{
Text = "<br>" + image.description
}; 我在图像描述之前添加了一个br标签,这样图像描述就会出现在下一行。
https://stackoverflow.com/questions/8692216
复制相似问题