-1

How can i convert this to <asp:Image ID="Image1" runat="server" Width="300px" Height="300px" ImageUrl='<%#"data:Image/png;base64," + Convert.ToBase64String((byte[])Eval("Image"))%>' /> to cshtml? Can someone give me a hand?

<img src='data:Image/png;base64,' + @Convert.ToBase64String((byte[])Model.Image) alt="IMAGES" />

Error

Car Model

FFAE
  • 3
  • 6

1 Answers1

0

If you have Image property in your model then It should as simple as

<img src='data:Image/png;base64,' + @Convert.ToBase64String((byte[])Model.Image) alt="IMAGES" />
Gagan Deep
  • 1,508
  • 9
  • 13
  • Microsoft.CSharp.RuntimeBinder.RuntimeBinderException HResult=0x80131500 Message='System.Collections.Generic.List' does not contain a definition for 'Image' Source= StackTrace: – FFAE Feb 26 '19 at 15:47
  • Do you have a property in your Model class Cars?? – Gagan Deep Feb 27 '19 at 10:33