关于DataGrid控件中的列绑定!在线等。解决给分
wkzjl 2003-12-12 12:37:08 我想根据数据库中的不同值来绑定不同的图片,不知道该怎么办,下面代码不知道行不行,如果不行,请给出源代码
<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>