数据库里有一张表,从数据库里读取图片的GUID,显示在Repeater中。需要达到的效果:点某一家酒店,就会显示出某家酒店的图片。
显示图片列表为:每行三张图片,下面并附有文字说明。一共三行。
我希望得到完整的答案。谢谢!
显示图片列表为:每行三张图片,下面并附有文字说明。一共三行。
我希望得到完整的答案。谢谢!
解决方案 »
- 我在网站中新建了一个母版,但引用后 发现子页面中的代码却执行不了 没有错误 点击按钮后没有反应
- 大家讨论一下在专业软件公司和一般公司搞开发差别
- 100分求助!sql语句更新access数据库更新失败
- Application不起作用???如下代码
- 帮个小忙来坐坐
- vs2005被卡巴误删,怎么办?
- 【新手提问】异步调用?或用子线程? C#允许创建几个子线程?100个线程池,会影响系统性能吗?
- DataGrid的简单问题
- **********************关于程序结构设计的方案请教***************************
- 这个错误是怎么回事!
- 请一份关于网络方面的投标书
- 请教大虾们一个问题,类似淘宝那种尺码和颜色功能是怎么实现的?
table ?div ?ul ?
你是求个页面啊 ?
第1种方法:<asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate>
<%#(Container.ItemIndex) % 5 == 0 ? "<ul>" : String.Empty%>
<li>abc</li> <%#(Container.ItemIndex) % 5 == 4 ? "</ul>" : String.Empty%>
</ItemTemplate>
</asp:Repeater> 第2种方法:<asp:Repeater ID="Repeater2" runat="server"
onitemdatabound="Repeater2_ItemDataBound">
<ItemTemplate>
<asp:Literal ID="HeadLiteral" runat="server"></asp:Literal>
<li>abc</li>
<asp:Literal ID="FooterLiteral" runat="server"></asp:Literal>
</ItemTemplate>
</asp:Repeater>-----------------------------------------------------------------------------------------------------------protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemIndex % 5 == 0)
{
Literal HeadLiteral = (Literal)e.Item.FindControl("HeadLiteral");
HeadLiteral.Text = "<ul>";
}
if (e.Item.ItemIndex % 5 == 4)
{
Literal FooterLiteral = (Literal)e.Item.FindControl("FooterLiteral");
FooterLiteral.Text = "</ul>";
}
}
table ?div ?ul ?
你是求个页面啊 ?我用的是table
现在我都不知道绑在哪里,所以页面我想求一个。代码部分可以不用给我。
大哥,我还想用DataList呢,但是得跟别人统一起来呀,因为这个项目都用Repeater。
RepeatColumns="10" onitemdatabound="dlList_ItemDataBound"
onitemcommand="dlList_ItemCommand">
<ItemTemplate>
<table class="table">
<tr>
<td>
<table>
<tr>
<td><asp:ImageButton ToolTip='<%# Eval("Re") %>' Width="100px" Height="100px" runat="server" ID="imgUrl" ImageUrl='<%# Eval("ImgUrl") %>' />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblRe" Text='<%# Eval("Re") %>'></asp:Label>
<asp:Label runat="server" ID="lblID" Text='<%# Eval("ID") %>' Visible="false"></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater > RepeatColumns控制每行的图片显示数量