Skip to main content
added 63 characters in body
Source Link
Gabe
  • 50.6k
  • 29
  • 147
  • 182

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

MVC4

<img src="~/Content/images/myimage.png" />

You could convert the byte[] into a Base64 string on the fly.

string base64String = Convert.ToBase64String(imageBytes);

<img src="@String.Format("data:image/png;base64,{0}", base64string)" />

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

You could convert the byte[] into a Base64 string on the fly.

string base64String = Convert.ToBase64String(imageBytes);

<img src="@String.Format("data:image/png;base64,{0}", base64string)" />

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

MVC4

<img src="~/Content/images/myimage.png" />

You could convert the byte[] into a Base64 string on the fly.

string base64String = Convert.ToBase64String(imageBytes);

<img src="@String.Format("data:image/png;base64,{0}", base64string)" />
deleted 4 characters in body
Source Link
Gabe
  • 50.6k
  • 29
  • 147
  • 182

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

You could convert the imagebyte[] into a Base64 stringBase64 string on the fly.

 string base64String = Convert.ToBase64String(imageBytes);

   <img src="@String.Format("data:image/png;base64,{0}", base64string)" />

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

You could convert the image into a Base64 string on the fly.

 string base64String = Convert.ToBase64String(imageBytes);

   <img src="@String.Format("data:image/png;base64,{0}", base64string)" />

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

You could convert the byte[] into a Base64 string on the fly.

string base64String = Convert.ToBase64String(imageBytes);

<img src="@String.Format("data:image/png;base64,{0}", base64string)" />
Source Link
Gabe
  • 50.6k
  • 29
  • 147
  • 182

Make sure you image is a relative path such as:

@Url.Content("~/Content/images/myimage.png")

You could convert the image into a Base64 string on the fly.

 string base64String = Convert.ToBase64String(imageBytes);

   <img src="@String.Format("data:image/png;base64,{0}", base64string)" />