【发布时间】:2019-05-25 04:00:35
【问题描述】:
在我的应用程序中,我使用 datalist 来显示图像,我放置了 repeatcolumn=4 和 reapeatdirection=horizontal 的属性。如果只有 1 个或 2 个或 3 个图像,并且图像之间的间隙 r 太长,则当有 r 个或 4 个以上的图像时显示良好。如果我只有一张图像,则图像显示在数据列表中间的数据列表中。我怎么解决这个问题。我想你们理解我的问题这是我的 datalist 源代码... datalist width="100%"
<asp:DataList ID ="dtlstallfrind" RepeatColumns ="4" RepeatDirection="horizontal"widht=100>
<ItemTemplate >
<table width="100%" >
<tr>
<td >
<asp:ImageButton ID="imgeFrien" runat ="Server" Width="110px" Height ="100px" CommandName ="Image" CommandArgument ='<%# Eval("userid") %>' ImageUrl ='<%# "~/Userimages/"+ Eval("myimage") %>' />
</td>
</tr>
<tr>
<td >
<asp:Label ID="lblFrieNam" runat ="Server" Font-Names ="verdana" Text ='<%# Eval("username") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
【问题讨论】:
标签: asp.net