I want to display an image if 2 conditions are met.
- The data item is not null
- The value of the data item is greater than 0
Markup
<img id="Img1" runat="server" visible='<%#IIF( DataBinder.Eval(Container.DataItem,
"amount") is DBNull.Value Or DataBinder.Eval(Container.DataItem,
"amount") = 0, False, True)%>' src="/Images/check.png" />
Error message
Operator '=' is not defined for type 'DBNull' and type 'Integer'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Operator '=' is not defined for type 'DBNull' and type 'Integer'.