关于DataGrid控件中的列绑定!在线等。解决给分

wkzjl wkzjl 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想根据数据库中的不同值来绑定不同的图片,不知道该怎么办,下面代码不知道行不行,如果不行,请给出源代码

<asp:TemplateColumn>
<ItemTemplate> <table width="30px" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <% Dim count As Integer %> = <%# DataBinder.Eval(Container.DataItem,"LWRestoreDegree")%> <%
If count = 0 Then Response.Write("<img src='Images\topic.gif' border='0'>") Else If (count > 0) And (count) < 15 Then Response.Write("<img src='Images\topic_n.gif' border='0'>") Else
Response.Write("<img src='Images\topic_hn.gif' border='0'>") End If %>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
...全文
评论 4
收藏 已收藏
分享
返回顶部
wkzjl
.NET社区 62,272 成员 668,968 内容