将图像绑定到MVC中的输入控件 [英] bind image to input control in MVC

查看:68
本文介绍了将图像绑定到MVC中的输入控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i通过输入类型控件以SQL Server字节格式保存图像

在编辑时我得到字节,如何将该图像绑定到输入控件?



是否可以从< image>获取图像字节control?

Hi,
i am saving image in SQL Server bytes format through input type control
While in editing i am getting bytes, how to bind that image to input control?

is it possible to get image bytes from <image> control ?

推荐答案

我们可以做到。



将这些字节转换为base64字符串并放入到图像()标签的src属性如下

Ya we can do it.

Convert those bytes into base64 string and put it into src attribute of image() tag as below
<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />


这篇关于将图像绑定到MVC中的输入控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆