repeater 数据绑定问题

<asp:repeaterid="Repeater1"runat="server"onitemdatabound="Repeater1_ItemDataBound"><I... <asp:repeater id="Repeater1" runat="server" onitemdatabound="Repeater1_ItemDataBound">
<ItemTemplate>
<div class="rpList">
<li style="border-width: thin; border-color: #000000; border-bottom-style: ridge;">
<table width="100%" style="table-layout: fixed;">
<tr width="100%" height="0px">
<td rowspan="2" width="6%" align="left" style="word-wrap: break-word; table-layout: fixed;">
<a href="SpotDetails.aspx?spot_Id=<%#Eval("Id")%>"><asp:Image ID="imgSpot" Width="100%" Height="90%" runat="server" ImageUrl='<%# Eval("LargePic") %>'/></a>
</td>
<td align="left" style="color: #000000">
<a href="SpotDetails.aspx?spot_Id=<%#Eval("Id")%>"><%#Eval("Name") %></a>
</td>
</tr>
<tr>
<td><asp:Image ID="imgStar" runat="server" /> (想在此处根据查询出来的<%#Eval("Level")%>决定显示那张图片,比如:<%#Eval("Level")%>=1 或者<%#Eval("Level")%>=2时,imgStar的ImageUrl显示某一张图片,<%#Eval("Level")%>=3时imgStar的ImageUrl显示另一张图片)</td>
</tr>
</table>
</li>
</div>
</ItemTemplate>
</asp:repeater>

请问如上效果怎么实现,请各位指点。
展开
 我来答
printf59277
2011-01-11 · TA获得超过1080个赞
知道大有可为答主
回答量:1812
采纳率:33%
帮助的人:1263万
展开全部
在项绑定事件中 找到imgStar 这个控件。至于你那个值,我觉得可以用隐藏域来保存,然后在一起找到。然后再判断隐藏域绑定的值来判断这个img控件显示哪个值。
Storm代理
2023-07-25 广告
StormProxies是一家可靠的代理服务提供商,提供原生IP(住宅原生IP)和高匿名代理服务。以下是关于StormProxies的原生IP服务的一些信息:1. 住宅原生IP:StormProxies提供的住宅原生IP是指从真实的家庭或企... 点击进入详情页
本回答由Storm代理提供
百度网友b9f6e14
2011-01-11 · 超过67用户采纳过TA的回答
知道小有建树答主
回答量:437
采纳率:0%
帮助的人:180万
展开全部
这种你可以这样 比如:a表 b表
a表是你数据要绑定的表,b表就是图片表
a表放图片的id b表放图片的id跟 图片路径

联合查询select a.*,b.path from a ,b where a.id=b.id 再绑定 imag 对应path字段
Are you ok?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式