How to display image inside web form from Byte Array with C#

前端 未结 3 910
温柔的废话
温柔的废话 2020-12-16 04:41

This is my code, all it does is clear the web page and draw the image, so the rest of the form disappears! I need to show the image inside the form.

This is my User

3条回答
  •  自闭症患者
    2020-12-16 05:25

    There is also another simple way:

    1. On your .aspx page:

      
      
    2. Then in your CodeBehind file .aspx.cs:

      Image1.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(Foto)
      

提交回复
热议问题