Himanshu Tyagi

Himanshu Tyagi

  • NA
  • 119
  • 15.7k

How to show default image if there is no image in database i

Mar 29 2018 2:19 AM
I am using a repeater to show an image but if there is no image in database i want a default image there so how can i do this? please help
 
<asp:Repeater ID="rptrClientImage" runat="server">
<ItemTemplate>
<asp:Image ID="Img" alt="User Picture" runat="server" ImageUrl='<%# "data:image/jpg;base64," + Convert.ToBase64String((byte[])Eval("IMAGE")) %>' Visible='<%# Convert.ToBase64String((byte[])Eval("IMAGE"))!="AAAAAA=="%>' Style="z-index: 5; height: 90px; width: 90px; border: 3px solid; border-color: rgba(255,255,255,0.2); border-radius: 50%; vertical-align: middle;" />
</ItemTemplate>
</asp:Repeater>
 

Answers (1)