S
simon
I have item template:
<ItemTemplate>
<%#
writeProcent(DataBinder.Eval(Container.DataItem,"strosekProcentBrez")) %>
</ItemTemplate>
and function in code behind:
Protected Function writeProcent(ByVal vrednost As Decimal) As String
If vrednost = 100 Then
writeProcent = "<font color=red>-</font>"
Else
writeProcent = vrednost
End If
End Function
when I execute the page,I get an error message:
cast from type 'DBNull' to type 'Decimal' is not valid
How can I check if DataBinder.Eval is not null?
Thank you,
Simon
<ItemTemplate>
<%#
writeProcent(DataBinder.Eval(Container.DataItem,"strosekProcentBrez")) %>
</ItemTemplate>
and function in code behind:
Protected Function writeProcent(ByVal vrednost As Decimal) As String
If vrednost = 100 Then
writeProcent = "<font color=red>-</font>"
Else
writeProcent = vrednost
End If
End Function
when I execute the page,I get an error message:
cast from type 'DBNull' to type 'Decimal' is not valid
How can I check if DataBinder.Eval is not null?
Thank you,
Simon