首页 > 代码库 > EasyUI 读数据库图

EasyUI 读数据库图

EasyUI 读数据库图

      function edit_dg() {
            //选中一行,获取这一行的主键值
            var idImg = $("#tbDeviceClassBrowstab").datagrid(getSelected).pid;
             $("#imgId").attr("src", "/ashx/Device/tbDeviceClass.ashx?action=image&pid=" + idImg);
     <td style=" padding:5px; " colspan="1" rowspan="8" >
                      <img id="imgId" alt="图片" border=0 align="middle"  src=http://www.mamicode.com/""  width="200" height="200"> </img>
                   </td>

后台:

                byte[] imagebytes = null;
                imagebytes = (byte[])dtimg.Rows[0]["DevImage"];
                HttpContext.Current.Response.ContentType = "image/jpeg";
                HttpContext.Current.Response.BinaryWrite(imagebytes);

 

EasyUI 读数据库图