I have a field in a dataset called CALLACK which contains either 1 or 0.
In my datagrid I wish to display an image based upon this value. To do this I use itemtemplate :
<asp:TemplateColumn HeaderText="" HeaderStyle-Width="25" Visible="True">
<ItemTemplate>
<asp:image runat="server" ImageUrl='<%# SetDisImage(Databind.Eval Container,"DataItem.dbo.view_customers_calls.CALLACK"))%>'>
</asp:image>
</itemtemplate>
</asp:TemplateColumn>
The SetDisImage function is as follows:
Protected Function SetDisImage(ByVal bol As Boolean)
Dim strURL = ""
Dim strYes = "status_new.gif"
Dim strNo = "status_open.gif"
If bol Then
strURL += strYes
Else
strURL += strNo
End If
Return strYes
End Function
WHen I run the page I get the following error:
Expression does not produce a value.
Can someone please tell me what I am doing wrong. The code I got from the web and it seems pretty clear to me.
Thanks in Advance



Reply With Quote