Im recently new to ASP.NET C# and have a website that is showing images from a database and I only want to show the image if the value is set to true.
Database has fields Image1 - this is the image path and Image1_Show - Bit Value represent true or false
Then I have the code below
<a href='<%# "../images/cars/" + Eval("Image1") %>'><asp:Image ID="img1" Visible='<%# Eval("Image1_Show") %>' runat="server" Border="0" ImageUrl='<%# "../images/cars/thumbnails/small/" + Eval("Image1") %>' /></a>
But i keep getting the error: Specified cast is not valid.
I have been trying to get this to work for a few days so any help would be amazing